Turtel
Turtel

Reputation: 1259

Jquery Ajax dynamic forms

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

Answers (2)

Chandresh M
Chandresh M

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

xdazz
xdazz

Reputation: 160833

You can use .serialize() to encode a set of form elements as a string for submission.

Upvotes: 0

Related Questions