Thursday, December 20, 2012

Jquery Dropdownlist validation in asp.net

Title: JQuery How to validate Drop Down List value  in asp.net

Description:
Recently i have worked drop down list data validation using JQuery. Now i would like to explain how to validate the data of drop down list using JQuery .In previous articles i have given an example on Jquery drop down validation,JQuery allow only numbers.Here in this post i will given script for Validate DropdownList Using JQuery
Example:
   $(document).ready(function () {
    $('#btnsubmit').click(function(){
        cntydr = $('#ddlcountry');
        if (cntydr.length == 0 || $(cntydr).val() == "") {
            alert("Please Choose Country");
        }
        });
    });
As you can see the below screen shots to know the how they will get validation  conformation on page
In the above script i have used button click event to perform the validation.So when ever we click on the submit button the validations will be done.
Post a Comment

Bel