This is a migrated thread and some comments may be shown as answers.

how to make RegExpTextBoxSetting allow empty string

2 Answers 96 Views
Input
This is a migrated thread and some comments may be shown as answers.
Web team
Top achievements
Rank 1
Web team asked on 27 Apr 2010, 04:21 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 29 Apr 2010, 10:56 AM
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.
0
Web team
Top achievements
Rank 1
answered on 29 Apr 2010, 11:03 AM
that seem to work. thanks
Tags
Input
Asked by
Web team
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Web team
Top achievements
Rank 1
Share this question
or