Jump to content

conditionals regarding input elements


jimfog

Recommended Posts

Suppose I have a page with some input elements...some are disabled some other are non-visible.

 

What conditional should I write to test for the above case...based on this fact I want to perform an action.

 

Saying it with another words....how am I going to test that the page DOES NOT have visible and non-disabled input elements

 

An example https://jsfiddle.net/fiddlehunt/weveks9f/32/ ...one input is disabled and the other is hidden.

 

I tried to use the code in line 32 but it does not test for that....

Link to comment
Share on other sites

  • 2 weeks later...

 

Combine :disabled and :hidden together (not ! :visible), it will give a AND condition effect. for example

if($('.time').is(':disabled:hidden')){///carry out code}

Yes that seems to be the solution...thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...