Reputation: 10789
Trying to display a message for each text box which the user didn't enter a value.
This is how HTML looks :
<tr>
<td class="TextBold">
<input name="ctl00$DefaultContent$ctl15" type="text" class="TextNormalJQH" style="width:36px;" /></td>
<td class="TextBold" align="left" valign="middle"></td>
</tr>
Jquery
$(':text.TextNormalJQH').filter('[value=""]').closest('td').next().val() = "Answer is necessary";
The above statment throughs an error
Thanks in advance
BB
Upvotes: 0
Views: 386
Reputation: 966
You've got some work to do on your selectors.
$(':text[:empty]').parent('td').next('td').html("Answer is necessary");
fiddle: http://jsfiddle.net/brentmn/xbEwG/
Upvotes: 1