I'm trying to get the value of an form input, which is inside a table cell, but it is getting returned as undefined.
$('.js-form').submit(function(event) {
alert($(this).children().has("input[name='points']").val());
});
My HTML is as follows:
<tr>
<form action='...' method='post' class='js-form'>
<td><input type='text' name='points'/></td>
</form>
</tr>
There are multiple of these forms on the same page, I'm under the impression that using $(this)
will restrict my DOM traversal to the selected form that the function is currently handling, but not sure why I don't get any value back? (there is a value in the field)