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?
I also thought about changing it to .closest('form'), since table is on the same level as the submit button, but that didn't make any difference. I also tried it with the .find() that you suggested, and still no luck.
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.
Unfortunately, the only thing I'm getting is "undefined". What's the proper way to traverse to get what I'm looking for?
I also thought about changing it to .closest('form'), since table is on the same level as the submit button, but that didn't make any difference. I also tried it with the .find() that you suggested, and still no luck.
Any other suggestions?