Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Applying if condition on some specific index of select box

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 282
    Comment on it

    If we want to apply condition on changing of specific indexed value of select box we simply do this:

    $('#select_id').change(function(){ 
        if(((parseInt($('option:selected',$(this)).val()))==2)||((parseInt($('option:selected',$(this)).val()))==3)||((parseInt($('option:selected',$(this)).val()))==4)||((parseInt($('option:selected',$(this)).val()))==5)){ 
                        // do something..
                    }
                    else
                    {
                        // do something else..
                    }
                });
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: