This question already has answers here:
</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/1960240/jquery-ajax-submit-form" dir="ltr">jQuery AJAX submit form</a>
<span class="question-originals-answer-count">
(20 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2015-11-20 15:17:31Z" class="relativetime">4 years ago</span>.</div>
</div>
</aside>
I am looking to submit a page full of quantities to a page and then return their values. I have the following:
<input type="number" name="item1" />
<input type="number" name="item2" />
<input type="number" name="item3" />
<input type="number" name="item4" />
<input type="number" name="item5" />
AJAX:
function getnames(){
$.ajax({
method: 'post','getnames.php',
data: {
'order': order,
'ajax': true
}
success: function() {
});
}
});
}
I want to find a way to post all input fields that contain the string "item" in the name so my question is:
How do I put a variety of input fields into a javascript array and then post them using ajax?
</div>