AJAX Submit via Post all Form

I'm trying to just post the whole form without having to create a url, as you would need to get a call. All the tutorials that I saw for this, for some reason, create the URL of the parameter and send it through the sending ability. I want to be able to submit the form via the form identifier or form name, is this possible? The reason is that I will have some views, which can have from 2 to 1000 flags that the user can click (not my choice). The example I was looking at is basically this: http://www.captain.at/howto-ajax-form-post-request.php

I use type = "button" to make submit not in exchange or something like that.

+3
source share
3 answers

Use jQuery and it is very simple:

$.post("/myactionpage.php",$("#formID").serialize(), function (data) { whatever(); });
+6
source

If you can use jQuery, the JQuery Form plugin does just that.

The jQuery form plugin allows you to easily and unobtrusively update HTML forms to use AJAX. The core methods ajaxForm and ajaxSubmit collect information from the form element to determine how to control the submit process.

+1
source

, , GET. POST, . , jQuery - . , jQuery, google "ajax " .

0

Source: https://habr.com/ru/post/1755375/


All Articles