Totally blanking on how to construct – multiple HTML forms on page, ex:
<form action=”” method=”post” role=”form” id=”someid”>
<input type=”hidden” name=”id” value=”9″>
<input type=”submit” value=”Submit”>
</form>
using function below to submit via AJAX (works fine).
$(function() {
$(‘form’).on(‘submit’, function (e) {
$.ajax({
type: ‘post’,
url: ‘my.php’,
data: $(this).serialize(),
success: function () {
}
});
e.preventDefault();
});
});
How do I reference an individual data item inside the “on submit” function to get it’s value, like:
$(this).input[name=id].val() [does not work]
I want the value of the input name id, IE: “9”