Trying to check if a text box is visible then the user should enter a value in it.
the below piece doesn’t work.
if ($(':text.TextNormalJQH').is(':visible').filter('[value=""]').length > 0)
{
alert (" Entering data for all the visbile textboxes is mandatory");
}
Thanks in advance
BB
You’re really close. Just change it to:
Or, you could do this:
The reason you’re having problems is your use of
.is(). Basically, it returns true if any of the matched items pass it, filter returns the matched items. http://api.jquery.com/is/