I have 3 tabs in a tab strip and 3 multi page views. inside these multi page views are three tables i.e. code of three pages one by one.
First multipageview contains a form with a few text fields etc. When I use validation controls, like required field validation, on first tab's form it do not allow me to go to the next tab untill the validation is done on the form. I want it to go to next tab without validation. or in other words I want it to do validation only on the button clicked on respective tab, not when a tab is clicked.
Please help.
16 Answers, 1 is accepted
I was working on a large size project so wont be able to port whole project here but following is an example.. please check if it helps. Key is give ValidationGroup same to the validation controls and button.
Example of Control... check the ValidationGroup parameter
<telerik:RadDatePicker ID="PaymentReqDate" runat="server">
<Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
</Calendar>
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
<DateInput ID="DateInput1" runat="server" DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy"></DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="PaymentReqDate" ErrorMessage="Please Enter The Payment Required Date" ValidationGroup="abc">*</asp:RequiredFieldValidator>
//Example of Summary...
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Rectify These Errors" ValidationGroup="abc" />
//Example of Button
<asp:Button ID="btnSubmit" runat="server" Text="Submit" ForeColor="#4c79a6"
ValidationGroup="abc" onclick="btnSubmit_Click" />
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"
ontabclick="RadTabStrip1_TabClick" SelectedIndex="0" Skin="Black"
MultiPageID="RadMultiPage1" CssClass="tabStrip" >
<Tabs>
<telerik:RadTab runat="server" Text="Seja um Representante" Selected="True" >
</telerik:RadTab>
<telerik:RadTab runat="server" Text="Solicite um Representante">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"
CssClass="multiPage" Height="16px" Width="401px" >
<telerik:RadPageView ID="RadPageView1" runat="server">
<label> * Nome</label>
<br />
<telerik:RadTextBox ID="Nome" runat="server" Height="15px" Width="300px"
ValidationGroup="Representante"> </telerik:RadTextBox>
<br />
<label> * Região de Atuação </label>
<br />
<telerik:RadTextBox ID="Regiao" runat="server" Height="15px" Width="300px"
ValidationGroup="Representante"></telerik:RadTextBox>
<br />
<label > Endereço </label>
<br />
<telerik:RadTextBox ID="Endereco" runat="server" Height="15px" Width="300px"
EmptyMessage="Rua joão da silvea " ValidationGroup="Representante">
</telerik:RadTextBox>
<br />
<label> Complemento</label>
<br />
<telerik:RadTextBox ID="Complemento" runat="server" Height="15px" Width="300px"
EmptyMessage="Nº 123 Bairro vila alta " ValidationGroup="Representante">
</telerik:RadTextBox>
<br />
<label>Cidade </label>
<br />
<telerik:RadTextBox ID="Cidade" runat="server" Height="15px" Width="300px"
ValidationGroup="Representante" >
</telerik:RadTextBox>
<br />
<label>Cep </label>
<br />
<telerik:RadNumericTextBox ID="cep" runat="server" DateFormat="00000-000"
DataType="System.Int16" EmptyMessage="00000-000" MaxLength="12"
ValidationGroup="Representante" >
<NumberFormat DecimalDigits="0" ZeroPattern="n" GroupSeparator="" />
</telerik:RadNumericTextBox> <telerik:RadComboBox ID="comboestado" runat="server" Skin="Black" Width="60px">
<Items>
<telerik:RadComboBoxItem Text="N/D" />
<telerik:RadComboBoxItem Text= "MA" />
<telerik:RadComboBoxItem Text="MT" />
<telerik:RadComboBoxItem Text="MS" />
<telerik:RadComboBoxItem Text= "MG" />
<telerik:RadComboBoxItem Text="PA" />
<telerik:RadComboBoxItem Text="PB" />
<telerik:RadComboBoxItem Text="PR" />
<telerik:RadComboBoxItem Text="PE" />
<telerik:RadComboBoxItem Text="PI" />
<telerik:RadComboBoxItem Text="RJ" />
<telerik:RadComboBoxItem Text="RS" />
<telerik:RadComboBoxItem Text="RO" />
<telerik:RadComboBoxItem Text="SC" />
<telerik:RadComboBoxItem Text="SP" />
<telerik:RadComboBoxItem Text="TO" />
<telerik:RadComboBoxItem Text="AC" />
<telerik:RadComboBoxItem Text="AL" />
<telerik:RadComboBoxItem Text="AP" />
<telerik:RadComboBoxItem Text="AM" />
<telerik:RadComboBoxItem Text="BA" />
<telerik:RadComboBoxItem Text="DF" />
<telerik:RadComboBoxItem Text="ES" />
<telerik:RadComboBoxItem Text="GO" />
</Items>
<WebServiceSettings>
<ODataSettings InitialContainerName="">
</ODataSettings>
</WebServiceSettings>
</telerik:RadComboBox>
<br />
<label>Falar Com </label>
<br />
<telerik:RadTextBox ID="falarcom" runat="server"
ValidationGroup="Representante">
</telerik:RadTextBox>
<br />
<label>DDD + NUMERO </label>
<br />
<telerik:RadMaskedTextBox ID="tel" runat="server"
Mask="(###) ####-####" ValidationGroup="Representante">
</telerik:RadMaskedTextBox>
<br />
<label>Email: </label>
<br />
<telerik:RadTextBox ID="email" runat="server" Height="15px" Width="300px"
ValidationGroup="representante">
</telerik:RadTextBox><br />
<asp:RegularExpressionValidator ID="emailValidator" runat="server" Display="Dynamic"
ErrorMessage="Por favor, entra com e-mail válido." ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
ControlToValidate="email" ValidationGroup="Representante"></asp:RegularExpressionValidator> <br />
<asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" Display="Dynamic"
ControlToValidate="email" ErrorMessage="Por favor, entre com seu e-mail!" ValidationGroup="Representante" />
<br />
<label>Breve comentário sobre você : </label>
<br />
<asp:TextBox runat="server" ID="comentario" Rows="10" TextMode="MultiLine"
Width="300px" ValidationGroup="Representante"></asp:TextBox>
<br />
<br />
<input type="button" value="Limpar" id="btnSend" onclick="return btnSend_onclick()" />
<telerik:RadButton ID="RadButton1" runat="server" Text="Enviar"
onclick="RadButton1_Click" Skin="Black"
OnClientClicking ="btnSend_onclick()" >
</telerik:RadButton>
<telerik:RadButton ID="RadButton1" runat="server" Text="Enviar" ValidationGroup="Representante"
onclick="RadButton1_Click" Skin="Black"
OnClientClicking ="btnSend_onclick()" >
</telerik:RadButton>
toboyramos@gmail.com
I'm just not able to attach only because the site attached images
make sure you send me only one file.