nagalenoj Posted December 8, 2008 Share Posted December 8, 2008 Dear friends, I have placed a combo box in my web page. If I didn't select any values in the combo box, the first value in the combo box is taken. But, I want the user must have to select one value, else I have to display an error. Now, I am managing this by having an empty value in the beginning and check for the empty value after submission, Is, there any parameter or any other way to solve my problem? Quote Link to comment https://forums.phpfreaks.com/topic/136012-question-about-combo-box/ Share on other sites More sharing options...
haku Posted December 8, 2008 Share Posted December 8, 2008 That's the way you do it. Quote Link to comment https://forums.phpfreaks.com/topic/136012-question-about-combo-box/#findComment-709187 Share on other sites More sharing options...
Maq Posted December 8, 2008 Share Posted December 8, 2008 Use javascript, check to see if the selection == 0, if so display an alert or w/e you want to do. You should have a function that returns either true or false depending on your error checking. I just found this on google real quick, there is a client side check for non-selections. You should also check server side in-case the user has JS disabled. If you have specific trouble please post it. Quote Link to comment https://forums.phpfreaks.com/topic/136012-question-about-combo-box/#findComment-709194 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.