Wednesday, August 21, 2013

Disable Radbutton postback w/ validation

       function ValidateLastName(button, args) {
            var txtLastName = $find('txtLastName');
            if ( txtLastName.get_value() == '') {
                alert('At least lastname should be entered');
                button.set_autoPostBack(false);
            }
            else { button.set_autoPostBack(true); }
        }
 
           <telerik:RadButton runat="server" ID="btnLookup" OnClick="btnLookup_Click"  
Text="Lookup"  OnClientClicking="ValidateLastName">
                            </telerik:RadButton> 

1 comment:

  1. Anonymous8:08 PM

    Thanks for the code!

    ReplyDelete