php - Capturing entire form input data with JavaScript and sending it over AJAX -


i have dynamically generated form submit using ajax. form contains input fields , checkboxes - total number of checkboxes submitted unknown @ start. "dynamically generated" mean contents , id's of form elements pulled db , again, never know how many there in advance.

from understand, submit ajax need execute in javascript function:

xmlhttp.open("get","/incl/myfile.php?var[]=a&var[]=b&...", true); 

my problem generating "var[]=a&var[]=b&..." lists. particularly, have hard time understanding how generate checkboxes, may or may not checked.

is there capture entire content of form input fields , format nice url query? plugin perhaps? in jquery maybe?

yes, take @ jquery's serialize method. http://api.jquery.com/serialize/


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -