show-notice
hide-notice

Thursday 15 August 2013

Validate ASP.NET RadioButtonList using jQuery


Introduction:

ASP.NET RadioButtonList control is used to create a group of radio buttons, where all are rendered as an individual <input type=radio></input>. So in this post, I will show you how to validate ASP.NET RadioButtonList using jQuery.

ASPX:


    
    
    
    
    



JS:
$(document).ready(function() {
    $('#btnSubmit').on('click', function(e) {
        var cnt = $("#rdlList :radio:checked").length;
        if (cnt == 0) 
        {
            alert('Select any option.');
            e.preventDefault();
        }
        else 
            alert('Well Done!!!!');
    });
});​

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com