1

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.

4

3 回答 3

3

try this

     if($('label:visible').length)
      {
          //disable the submit button here
      }
于 2013-01-03T09:18:46.407 回答
1

try :visible to check if it is not hidden and length() to count the elements

if($('label:visible').length)..
于 2013-01-03T09:19:53.050 回答
1

You can use jQuery .is(":visible") to find if an element is visible.

于 2013-01-03T09:19:57.920 回答