validation on dropdown list
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me
Use JavaScript. On ClientClick of Submit button check DropDownList Text. If it "
Blank
" or "Select
" the throw message andreturn false
.cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me
U need to write the validation in java script for this to work. as follows function ddlValidation() { if (document.getElementById(.Selectedindex) == "-1" { alert('Select the item and proceed'); return false; } else return true; } if u want to show this message on click event of any button say 'Save' for example and id for the button is btnSave then call the above function from coding as follows btnSave.Attributes.Add("OnClick","javascript: return ddlValidation()"); try with this one....
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me
Ya, You can use JavaScript to validate the drop-down list. But side by side, you also should check it in the code-behind on the clieck event of the submit button. Though it will be a server side action, but if javascript will be disabled in the client's browser thn the server side code will do the trick for you. :)
Either you love IT or leave IT...
-
U need to write the validation in java script for this to work. as follows function ddlValidation() { if (document.getElementById(.Selectedindex) == "-1" { alert('Select the item and proceed'); return false; } else return true; } if u want to show this message on click event of any button say 'Save' for example and id for the button is btnSave then call the above function from coding as follows btnSave.Attributes.Add("OnClick","javascript: return ddlValidation()"); try with this one....
thanks for support how can i used this script in btnsave button i am using asp.net please give the aspbutton code onec again thanks for support
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me
-
Hi i have dropdown list in my webpage and the code for the dropdown list is i want to put some validation control on dropdownlist that is user should select one product without this it is not going submit i mean it will get message that please select one product how can i do this please help me