Validating multiple textboxes

2 posts, 0 answers
  1. Nelson
    Nelson avatar
    1 posts
    Member since:
    Aug 2012

    Posted 07 Aug 2012 Link to this post

    Hi all!,

    I need to validate that some textboxes are required. Can I validate them in one TextBoxSetting section as a whole?.

    <telerik:RadInputManager ID="RadInputManager1" runat="server">
        <telerik:TextBoxSetting BehaviorID="txtSettings" ErrorMessage="Requerido.">
            <Validation IsRequired="true" ValidationGroup="vgSolicitud" />
            <TargetControls>
                <telerik:TargetInput ControlID="celular" />
                <telerik:TargetInput ControlID="fechaocurrencia" />
                <telerik:TargetInput ControlID="sintomas" />
            </TargetControls>
        </telerik:TextBoxSetting>
    </telerik:RadInputManager>

    Thanks for the help guys!.

    Regards,
    Nelson Campos.
    Caracas, Venezuela. 
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Aug 2012 Link to this post

    Hi Nelson,

    Try the folowing code to achieve your scenario.

    ASPX:
    <telerik:RadInputManager ID="RadInputManager1" runat="server"  >
      <telerik:TextBoxSetting BehaviorID="txtSettings" ErrorMessage="Requerido.">
       <Validation ValidateOnEvent="All" IsRequired="true" ValidationGroup="vgSolicitud"/>
       <TargetControls>
        <telerik:TargetInput ControlID="celular" />
        <telerik:TargetInput ControlID="fechaocurrencia" />
        <telerik:TargetInput ControlID="sintomas" />
      </TargetControls>
     </telerik:TextBoxSetting>
    </telerik:RadInputManager>
    <asp:Button ID="Button1" runat="server" ValidationGroup="vgSolicitud" />
    <asp:TextBox ID="celular" runat="server" ></asp:TextBox>
    <asp:TextBox ID="fechaocurrencia" runat="server" ></asp:TextBox>
    <asp:TextBox ID="sintomas" runat="server" ></asp:TextBox>

    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top