I have some labels on my html page, I use them for validation errors, If all the input data is right then I hide those labels, and if not, showing accordingly. I want, if any of the label is shown then, disable the submit button.
Asked
Active
Viewed 168 times
3 Answers
3
try this
if($('label:visible').length)
{
//disable the submit button here
}
![](../../users/profiles/1030202.webp)
YogeshWaran
- 2,191
- 1
- 22
- 32
1
try :visible
to check if it is not hidden and length()
to count the elements
if($('label:visible').length)..
![](../../users/profiles/1573683.webp)
bipen
- 34,730
- 9
- 44
- 61