I have a form with many input fields.
When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thanks to the tip from Simon_Weaver, here is another way you could do it, using
serializeArray:Note that this snippet will fail on
<select multiple>elements.It appears that the new HTML 5 form inputs don’t work with
serializeArrayin jQuery version 1.3. This works in version 1.4+