hi,
I have a 3 tabs strip in my page and I want to perform validation as you move from one strip to another. I used requiredfield validator for textboxes and compare validator for combo boxes ,so when i fill tab1 it won't allow me to go to tab2 even if all data is valid in tab1.
I tried to use validationGroup for every tab, but it doesn't do validation at all.
how to do validation on all three tabs??
I have a 3 tabs strip in my page and I want to perform validation as you move from one strip to another. I used requiredfield validator for textboxes and compare validator for combo boxes ,so when i fill tab1 it won't allow me to go to tab2 even if all data is valid in tab1.
I tried to use validationGroup for every tab, but it doesn't do validation at all.
how to do validation on all three tabs??
5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 26 Apr 2010, 11:22 AM
Helo Hamda,
Have you set the "CausesValidation" property of RadTabStrip to "True" ?
Regards,
Princy.
Have you set the "CausesValidation" property of RadTabStrip to "True" ?
Regards,
Princy.
0

hamda
Top achievements
Rank 1
answered on 27 Apr 2010, 07:15 AM
Yes I did :(, what else can cause this?
0
Hi hamda ketbi,
Please take a look at this demo for example of validation.
Could you please provide your code so we are able to help you?
Thank you!
All the best,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Please take a look at this demo for example of validation.
Could you please provide your code so we are able to help you?
Thank you!
All the best,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

hamda
Top achievements
Rank 1
answered on 28 Apr 2010, 08:52 AM
This is my code:
Please help.
<telerik:RadMultiPage ID="RadMultiPage1" Runat="server" Height="16px" |
SelectedIndex="0" Width="780px" BorderColor="#000099" |
BorderStyle="Double"> |
<telerik:RadPageView ID="RadShipView" runat="server" Height="16px" |
Selected="True"> |
<br /> |
<table class="style1"> |
<tr> |
<td class="style11" align="center" dir="rtl"> |
<asp:Label ID="Label8" runat="server" Font-Bold="True" Text="اسم الوسيلة " |
CssClass="Label" ></asp:Label> |
</td> |
<td align="right" dir="ltr" class="style12"> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" |
ControlToValidate="txtShipName" ErrorMessage="الرجاء ادخال البيانات">*</asp:RequiredFieldValidator> |
<telerik:RadTextBox ID="txtShipName" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
</td> |
</tr> |
<tr> |
<td class="style4" align="center" dir="rtl"> |
<asp:Label ID="Label9" runat="server" Font-Bold="True" Text="نوع الوسيلة " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlShipType" Runat="server" |
AppendDataBoundItems="True" DataSourceID="ObjectDataSource1" |
DataTextField="ShipTypeName" DataValueField="ShipTypeId" EmptyMessage="--اختر--" |
Skin="Outlook" ValidationGroup="g1"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
    |
<asp:CompareValidator ID="CompareValidator1" runat="server" |
ControlToValidate="ddlShipType" ErrorMessage="الرجاء اختيار نوع الوسيلة" |
ValueToCompare="--اختر--" Operator="NotEqual"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td class="style4" align="center" dir="rtl"> |
<asp:Label ID="Label10" runat="server" Font-Bold="True" Text="قادمة من " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
 <telerik:RadComboBox ID="ddlFromCountry" Runat="server" |
AppendDataBoundItems="True" DataSourceID="ObjectDataSource2" |
DataTextField="CountryName" DataValueField="CountryId" EmptyMessage="--اختر--" |
Skin="Outlook"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
    |
<asp:CompareValidator ID="CompareValidator2" runat="server" |
ControlToValidate="ddlFromCountry" ErrorMessage="الرجاء اختيار الدولة" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
   |
</td> |
</tr> |
<tr> |
<td class="style4" align="center" dir="rtl"> |
<asp:Label ID="Label11" runat="server" Font-Bold="True" Text="متجهة إلى " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlToCountry" Runat="server" |
DataSourceID="ObjectDataSource2" DataTextField="CountryName" |
DataValueField="CountryId" Skin="Outlook" EmptyMessage="--اختر--" |
AppendDataBoundItems="True"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
   |
<asp:CompareValidator ID="CompareValidator3" runat="server" |
ControlToValidate="ddlToCountry" ErrorMessage="الرجاء اختيار الدولة" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td align="center" class="style4" dir="rtl"> |
<asp:Label ID="Label13" runat="server" CssClass="Label" Font-Bold="True" |
Text="ترفع علم "></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlFlag" Runat="server" |
DataSourceID="ObjectDataSource2" DataTextField="CountryName" |
DataValueField="CountryId" Skin="Outlook" AppendDataBoundItems="True" |
EmptyMessage="--اختر--"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
   |
<asp:CompareValidator ID="CompareValidator4" runat="server" |
ControlToValidate="ddlFlag" ErrorMessage="الرجاء اختيار الدولة" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td class="style4" align="center" dir="rtl"> |
<asp:Label ID="Label12" runat="server" Font-Bold="True" Text="المرفقات " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlAttachment" Runat="server" |
DataSourceID="ObjectDataSource3" DataTextField="FileName" |
DataValueField="AttachmentId" Skin="Outlook" AppendDataBoundItems="True" |
EmptyMessage="--اختر--"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
  |
</td> |
</tr> |
<tr> |
<td class="style9" align="center" dir="rtl"> |
<asp:Label ID="Label14" runat="server" Font-Bold="True" |
Text="رقم تعريف الوسيلة " CssClass="Label"></asp:Label> |
</td> |
<td align="right" class="style10"> |
<telerik:RadTextBox ID="txtShipId" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" |
ControlToValidate="txtShipId">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td align="center" class="style4" dir="rtl"> |
<asp:Label ID="Label23" runat="server" Font-Bold="True" Text="الوكيل الملاحي " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right"> |
<telerik:RadTextBox ID="txtCompany" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" |
ControlToValidate="txtCompany">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td align="center" class="style4" dir="rtl"> |
<asp:Label ID="Label25" runat="server" Font-Bold="True" |
Text="عنوان الوكيل الملاحي " CssClass="Label"></asp:Label> |
</td> |
<td align="right"> |
<telerik:RadTextBox ID="txtCompanyAddress" Runat="server" |
CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" |
ControlToValidate="txtCompanyAddress" ValidationGroup="g1">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td align="center" class="style2" colspan="2"> |
 </td> |
</tr> |
</table> |
<br /> |
<br /> |
</telerik:RadPageView> |
<telerik:RadPageView ID="RadPersonView" runat="server" Height="16px"> |
<br /> |
<table class="style1"> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="الاسم " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadTextBox ID="txtPersonName" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" |
ControlToValidate="txtPersonName">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label3" runat="server" Font-Bold="True" Text="الوظيفة " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlPersonType" Runat="server" |
DataSourceID="ObjectDataSource5" DataTextField="PersonTypeName" |
DataValueField="PersonTypeId" Skin="Outlook" EmptyMessage="--اختر--"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
   |
<asp:CompareValidator ID="CompareValidator5" runat="server" |
ControlToValidate="ddlPersonType" ErrorMessage="الرجاء اختيار الوظيفة" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label2" runat="server" Font-Bold="True" Text="الجنسية " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlPersonCountry" Runat="server" |
DataSourceID="ObjectDataSource2" DataTextField="CountryName" |
DataValueField="CountryId" Skin="Outlook" EmptyMessage="--اختر--"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
   |
<asp:CompareValidator ID="CompareValidator6" runat="server" |
ControlToValidate="ddlPersonCountry" ErrorMessage="الرجاء اختيار الجنسية" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label5" runat="server" Font-Bold="True" Text="رقم التعريف " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadTextBox ID="txtPersonId" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" |
ControlToValidate="txtPersonId">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label6" runat="server" Font-Bold="True" Text="المرفقات " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadComboBox ID="ddlPersonAttachment" Runat="server" |
DataSourceID="ObjectDataSource3" DataTextField="FileName" |
DataValueField="AttachmentId" Skin="Outlook"> |
</telerik:RadComboBox> |
  |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label7" runat="server" Font-Bold="True" Text="العنوان " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadTextBox ID="txtPersonAddress" Runat="server" |
CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" |
ControlToValidate="txtPersonName" ValidationGroup="g2">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td class="style8" align="right" dir="rtl"> |
<asp:Label ID="Label22" runat="server" Font-Bold="True" Text="ملاحظات " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadTextBox ID="txtNotes" Runat="server"> |
</telerik:RadTextBox> |
</td> |
</tr> |
<tr> |
<td align="center" class="style2" colspan="2"> |
<asp:Button ID="AddPersonBtn" runat="server" onclick="AddPersonBtn_Click" |
Text="إضافة شخص جديد" CssClass="Button" /> |
</td> |
</tr> |
</table> |
<br /> |
<br /> |
</telerik:RadPageView> |
<telerik:RadPageView ID="RadCargoView" runat="server" Height="16px"> |
<br /> |
<table class="style1"> |
<tr> |
<td class="style7" align="right" dir="rtl"> |
<asp:Label ID="Label15" runat="server" Font-Bold="True" |
Font-Names="Arabic Transparent" Text="نوع الحمولة " CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
 <telerik:RadComboBox ID="ddlCargoType" Runat="server" |
DataSourceID="ObjectDataSource4" DataTextField="CargoTypeName" |
DataValueField="CargoTypeId" Skin="Outlook" EmptyMessage="--اختر--"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="--اختر--" Value="--اختر--" /> |
</Items> |
</telerik:RadComboBox> |
   |
<asp:CompareValidator ID="CompareValidator7" runat="server" |
ControlToValidate="ddlCargoType" ErrorMessage="الرجاء اختيار نوع الحمولة" |
Operator="NotEqual" ValueToCompare="--اختر--"></asp:CompareValidator> |
</td> |
</tr> |
<tr> |
<td class="style7" align="right" dir="rtl"> |
<asp:Label ID="Label16" runat="server" Font-Bold="True" |
Font-Names="Arabic Transparent" Text="رقم المنفيست " CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<telerik:RadTextBox ID="txtMFTNumber" Runat="server" CausesValidation="True"> |
</telerik:RadTextBox> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" |
ControlToValidate="txtMFTNumber" ValidationGroup="g2">*</asp:RequiredFieldValidator> |
</td> |
</tr> |
<tr> |
<td class="style7" align="right" dir="rtl"> |
<asp:Label ID="Label17" runat="server" Font-Bold="True" Text="الوسيلة " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" dir="rtl"> |
<asp:Label ID="lblShip" runat="server" CssClass="Label"></asp:Label> |
</td> |
</tr> |
<tr> |
<td class="style5" align="right" dir="rtl"> |
<asp:Label ID="Label24" runat="server" Font-Bold="True" Text="مالك الحمولة " |
CssClass="Label"></asp:Label> |
</td> |
<td align="right" class="style6" dir="rtl"> |
<asp:Label ID="lblOwner" runat="server" CssClass="Label"></asp:Label> |
</td> |
</tr> |
<tr> |
<td align="center" class="style2" colspan="2"> |
 </td> |
</tr> |
<tr> |
<td align="center" class="style2" colspan="2"> |
<asp:Button ID="BtnInsertAll" runat="server" CssClass="Button" Height="27px" |
onclick="BtnInsertShip_Click" Text="Enter" Width="87px" /> |
</td> |
</tr> |
</table> |
<br /> |
<br /> |
</telerik:RadPageView> |
</telerik:RadMultiPage> |
Please help.
0
Hello hamda ketbi,
Thanks for the code.
Please take a look at the attached project for reference. You only need a RadTabStrip with MultiPageID set to the ID of the RadMultiPage and CausesValidation="true":
Hope this helps.
Best wishes,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thanks for the code.
Please take a look at the attached project for reference. You only need a RadTabStrip with MultiPageID set to the ID of the RadMultiPage and CausesValidation="true":
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"RadTabStrip1"
MultiPageID
=
"RadMultiPage1"
CausesValidation
=
"True"
SelectedIndex
=
"0"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"RadShipView"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"RadPersonView"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"RadCargoView"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
Hope this helps.
Best wishes,
Veronica Milcheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.