I do generate some <input>s with random names on the page (nearly ten at once).
Stuck on a question about submitting them.
I use this code to submit:
$('.table_data').submit(function(event)
{
event.preventDefault();
// some validation check and then
$.post(url, {user_mail: mail}, function()
{
alert('done);
});
});
The problem is, it submits user_mail only.
How do I submit data of all <input>s?
Have tried to use $.post(url, function(){}), it sends nothing.
Its possible to get all the inputs into array and then throw to the $.post function, but I’m not sure how to do it well.
If your form’s classname is
table_datathen use thisAnd you will get form input’s
namesas key of yourglobal POSTarray.Full code
Read more on $.serialize