Link to home
Start Free TrialLog in
Avatar of JMRFan4Life
JMRFan4Life

asked on

Javascript adn required field validation asp.net

hi,

i am using a required field validation on my dropdownlist. i have two drop downs and would like to hide one of the validators if both items have not been filled out. There should be a way to do this with javascript or JQuery. not sure how to do the test.

Thanks
SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JMRFan4Life
JMRFan4Life

ASKER

I actually used some javascript to get this done. below is my code actually used, but the examples above work jsut as well.

            if (ddlFPGenderChild1.selectedIndex == 0 && ddlFPRelationChild1.selectedIndex == 0) {
              $(rfvrel1valid).css({ "visibility": "visible", "display": "none" });
            };

i use selectedIndex to determine if the dropdowns have been selected or not. This case if first position is shown for both drop downs then hide one.