Reputation: 429
here is the situation.
so far i can different form with my jquery code below.
$("form[name='FormA']").submit(function(){
alert("FormA");
});
$("form[name='FormB']").submit(function(){
alert("FormB");
});
so now under both forms hava a input element like
<input type='text' name='ClientID' value=''>
and now how i call FormA ClientID or FormB ClientID ? something like ...
$("form[name='FormA']").submit(function(){
$(this + ":input[name='ClientID']).val(); ???
});
Upvotes: 1
Views: 67
Reputation: 145458
For example, using find
method:
$("form[name='FormA']").submit(function() {
var value = $(this).find("input[name='ClientID']").val();
});
Upvotes: 0
Reputation: 126082
$("form[name='FormA']").submit(function(){
$("input[name='ClientID']", this).val();
});
Upvotes: 1