how to make RegExpTextBoxSetting allow empty string

3 posts, 1 answers
  1. Web team
    Web team avatar
    57 posts
    Member since:
    Mar 2010

    Posted 26 Apr 2010 Link to this post

    I want my textbox to accept empty string or a string that matches my regular expression. I tried setting the IsRequiredFields to false but still it doesnt work. Thanks
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8482 posts

    Posted 29 Apr 2010 Link to this post

    Hello Arnold,

    This should be the default behavior of RadInputManager. Here is a simple demo:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     
    <head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
    <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:RegExpTextBoxSetting ValidationExpression="[0-9]{2}">
            <TargetControls>
                <telerik:TargetInput ControlID="TextBox1" />
            </TargetControls>
        </telerik:RegExpTextBoxSetting>
    </telerik:RadInputManager>
     
    Enter a two digit number or leave the textbox empty:
    <asp:TextBox ID="TextBox1" runat="server" />
     
    <asp:Button ID="Button1" runat="server" Text="PostBack" />
     
    </form>
    </body>
    </html>


    Best wishes,
    Dimo
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Web team
    Web team avatar
    57 posts
    Member since:
    Mar 2010

    Posted 29 Apr 2010 Link to this post

    that seem to work. thanks
Back to Top