Javascript for validating dropdownlist in asp net

16 Sep

I've 1 textbox, its for getting Date Time value, First the user has to fill the Date Time textbox before selecting the vehicle dropdown. The main function is is Date to which you can pass day, month and year.In this article you will see how to put validation in dropdownlist by javascript, suppose first item value of dropdownlist is 0 and text is "-Select-" just like given below and we have to validate that at least one item is selected excluding default i.e "-Select-".Just copy and paste javascript code given below and pass the parameter dropdownlist id, you can customize alert validation error message according to requirement.

Perform a Simple CRUD Operation using a Paging Enabled Grid View Control in Asp. Validations are important when you create forms that require your users to enter valid and complete data.You can have a Grid View control in your form to do multiple entries.Sometimes, when we build an input processing forms we might come across situations where we need to validate controls based on some conditions.For example, we can make a textbox to be required field only when a checkbox is checked or a dropdownlist value, etc.