Mr.Chowdary
Mr.Chowdary

Reputation: 507

javascript code to perform validation on select option?

I need some javascript code to validate a select option. Means something like this. Select Country : --select-- If the user submits the form without selecting country. we have to make a alert him saying
"please select the country".
Let me know how to do this and any sample code appreciatable
Thanks in Advance,
Laxman Chowdary

Upvotes: 0

Views: 932

Answers (2)

Mr.Chowdary
Mr.Chowdary

Reputation: 3407

By keeping

value=""

of the property you can validate it..

Upvotes: 1

bunsiChi
bunsiChi

Reputation: 125

try onClick event of jQuery, and just add an alert first for you to see how it works whenever that dropdown is being clicked.

Upvotes: 0

Related Questions