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
Post a Comment