I’ve got several forms on one page and I want to validate whether or not one of the fields on the form that is being submitted is filled in or not.
Basically my form looks like this:
So my thought process was, select THIS, which would be the submit button, then use closest() to go up the tree to the table, then go back down to .quantity, and get the value of that.
function checkform() {
alert($(this).closest('table').children('.quantity').val());
}
Unfortunately, the only thing I’m getting is “undefined”. What’s the proper way to traverse to get what I’m looking for?