Member_2_1316035
asked on
RequiredFieldValidator on dropdownlist
How can I force web users to explicitly select an option on the dropdowlist? By default, dropdownlist selects the one appears. It makes RequiredFieldValidator on dropdownlist useless.
Do I miss something about the Validator? If I can not make the validator to work, I can do dynimic validation on the server side but I don't know the best practice to do client validation.
Please help.
Biang
Do I miss something about the Validator? If I can not make the validator to work, I can do dynimic validation on the server side but I don't know the best practice to do client validation.
Please help.
Biang
ASKER
I am inspired by this article in google. Use CompareValidator with NotEqual to the default selected value.
http://www.google.com/groups?q=requiredfieldvalidator,+dropdownlist&hl=en&lr=&ie=UTF-8&selm=%23pCp6gYgBHA.1640%40tkmsftngp07&rnum=10
http://www.google.com/groups?q=requiredfieldvalidator,+dropdownlist&hl=en&lr=&ie=UTF-8&selm=%23pCp6gYgBHA.1640%40tkmsftngp07&rnum=10
yep that's a good idea..thank u for sharing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I believe ASP.NET should have designed RequiredFieldValidator to handle this normal scenario. Thank you praneetha for finding it out. I think th trick here is the setting of InitialValue. Well done!
thank u and you are welcome..i learnt something new too...
have a good weekend
have a good weekend
you can instead write javascript to check if the dropdownlist index chnaged