<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> <script type="text/javascript" language="javascript"> function validate() { var CompanyName = /^[A-Za-z0-9]{3,20}$/; var txtCompanyName = document.getElementById('<%=radtxtCompanyName.ClientID %>').value; if (!CompanyName.test(txtCompanyName)) { document.getElementById("<%=radtxtCompanyName.ClientID %>").style.borderColor = "red"; return false; } else { document.getElementById("<%=radtxthidden.ClientID %>").Text = "validate"; } } </script> </telerik:RadCodeBlock>
<telerik:RadButton ID="RadBtnSubmit" Text="Submit" runat="server" BackColor="#3399FF" ForeColor="White" Height="30px" Width="100px" ButtonType="LinkButton" AutoPostBack="true" OnClientClick="return validate()" önClick ="RadBtnSubmit_Click" />
protected void Page_Load(object sender, EventArgs e) { try { RadBtnSubmit.Attributes.Add("OnClick", "return validate()"); } catch (Exception ex) { ErrorLogClass.SendError(ex, "abcd", "PageLoad"); } }
RadBtnSubmit.Attributes.Add("OnClick", "return validate()");
return true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)