I want to grab all the inputs inside a form, in order to submit them.
The point of this is to use jquery’s ajax to submit a dynamically sized form.
Surely there must be an array inside the dom somewhere which i can just do something like…
docment.forms[‘form’].elements
which only lists inputs for that form, meaning I can loop through them and grab their values to play around with?
I want to grab all the inputs inside a form, in order to submit
Share
You can use the
:inputselector for this.Alternatively, you can also use the jQuery.serialize() function to serialize all inputs into a ready-to-use query string for the jQuery.ajax()‘s
dataparameter.