Controlling submit button which validates input manager entry

3 posts, 1 answers
  1. Arnold Guzmán
    Arnold Guzmán avatar
    3 posts
    Member since:
    May 2010

    Posted 23 Oct 2012 Link to this post

    Hi, 

    I want to create a textbox with a button, I tried using RegexTextBox with RadInputManager.  It works fine and does not cause any postback when use the proper button, but I also have another buttons inside my page that are not related to the functionality of the regex, and when the textbox is invalid, it does not cause postback.  I could not find any way to link inputManager just to the button i desire.  

    Is that possible?
  2. Answer
    Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 26 Oct 2012 Link to this post

    Hi Arnold,

    You could use ValidationGroup to control your validation configuration:
    <asp:TextBox ID="TextBox1" runat="server" ValidationGroup="RegExTextBox"></asp:TextBox> <br /> <br />
    <asp:Button ID="Button1" Text="Submit if valid" runat="server" />
    <asp:Button ID="Button2" Text="Ignore validation" runat="server" ValidationGroup="RegExTextBox" />
    <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:RegExpTextBoxSetting ErrorMessage="NaN" ValidationExpression="\d+">
            <TargetControls>
                <telerik:TargetInput ControlID="TextBox1" />
            </TargetControls>
        </telerik:RegExpTextBoxSetting>
    </telerik:RadInputManager>

    I hope this will prove helpful. Please give it a try and let me know about the result.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Arnold Guzmán
    Arnold Guzmán avatar
    3 posts
    Member since:
    May 2010

    Posted 26 Oct 2012 Link to this post

    Thanks! 

    It worked perfectly!
Back to Top