How to disable validation for one textbox inside a panel with the RadInputManager

2 posts, 0 answers
  1. Saied Hassaninia
    Saied Hassaninia avatar
    2 posts
    Member since:
    Feb 2010

    Posted 03 Feb 2010 Link to this post

    I have an asp:Panel that contains about 10 TextBox fields inside of it.  I set up a RadInputManager to ensure that the Textboxes are not empty, however, one of the TextBoxes is not required, but because it is wrapped in a asp:Panel, it thinks it needs to be validated.  Is there a way to override the validation?
  2. Radoslav
    Admin
    Radoslav avatar
    1566 posts

    Posted 09 Feb 2010 Link to this post

    Hello Saied,

    You could try to add the RadInputManager control into the asp:Panel control. Then you could add all TextBox controls which need validation into the RadInputManager's TargetControls collection:

    <asp:Panel runat="server" ID="panel">
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
      <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
      <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
      <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:TextBoxSetting InitializeOnClient="true"
           BehaviorID="TextBoxBehavior1" EmptyMessage="type here" Validation-
           IsRequired="true">
         <TargetControls>
           <telerik:TargetInput ControlID="TextBox1" />
           <telerik:TargetInput ControlID="TextBox2" />
         </TargetControls>
      </telerik:TextBoxSetting>
     </telerik:RadInputManager>
    </asp:Panel>

    Additionally I am sending you a simple example that illustrates how to achieve the desired functionality.
        
    I hope this helps.

    Best wishes,
    Radoslav
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top