BumbleBee
BumbleBee

Reputation: 10789

Display a message for each textbox - Validation - Jquery

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

Answers (1)

Brent Anderson
Brent Anderson

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

Related Questions