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

Validating multiple textboxes

1 Answer 76 Views
Input
This is a migrated thread and some comments may be shown as answers.
Nelson
Top achievements
Rank 1
Nelson asked on 07 Aug 2012, 03:29 PM
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. 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Aug 2012, 06:50 AM
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.
Tags
Input
Asked by
Nelson
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or