views:

228

answers:

1

Hi,

I am using the bassistance jquery plugin validation.

I have a drop down list with 2 values.

If the first value is selected by the user a valid datefield needs to be populated and if the second option is selected then a textbox needs to be filled with some text.

If nothing is selected then it need to return a validation on this as well

How can I achieve this?

thanks

A: 

Well, if it is a dropdown, you can't really have "nothing" selected. So, it sounds like in your case, you might want to make three options, the first of which is something like "Choose one", you can then you the jQuery to test for this condition and throw an alert if that value isn't one of the two that trigger an action. You can then force them to go back and choose of the two other options.

Nate B
yes, there will be a 'Please Select' option. I was hoping to use the validation plugin as described above not test using an if statement in jquery
kurasa