Reputation: 1259
I have a dynamically generated form and I want to submit to a PHP file using $.ajax
. How do I do that and what I can I assign on the data
property?
Upvotes: 2
Views: 323
Reputation: 3828
Use AJAX..
function ajaxfunc()
{
var datafield = $('#frm').serialize();
jQuery.ajax({
type: "GET",
url: "query_page.php",
data: datafield,
success: function(html){
// data you want to return on.
}
});
}
i think this makes you happy and satisfied.
Upvotes: 2
Reputation: 160833
You can use .serialize() to encode a set of form elements as a string for submission.
Upvotes: 0