Custom validator didn't fire when I am using RadMultiPage and tabstrip

2 posts, 0 answers
  1. Dorababu
    Dorababu avatar
    95 posts
    Member since:
    May 2012

    Posted 26 Jun 2012 Link to this post

    I am having my design with radtabstrip and RadMultiPage as follows
    <telerik:RadTabStrip ID="rdtabEmployee" runat="server" MultiPageID="rdmpPersonal"
                UnSelectChildren="True" Skin="WebBlue" EnableEmbeddedSkins="False" ClickSelectedTab="True"
                SelectedIndex="0" OnTabClick="tabClick">
                    <telerik:RadTab runat="server" Text="Personal" PageViewID="rdpgPersonal">
                    <telerik:RadTab runat="server" Text="Contact" PageViewID="rdpgContact">
    <telerik:RadMultiPage ID="rdmpPersonal" runat="server">
                <telerik:RadPageView ID="rdpgPersonal" runat="server" Selected="true">
                    <telerik:RadPanelBar runat="server" ID="rdpnlPersonal" ExpandMode="FullExpandedItem"
                        Skin="Vista" EnableEmbeddedSkins="false" Width="880px">
                            <telerik:RadPanelItem Expanded="true" Text="Employee Personal Information" runat="server"
                                    <telerik:RadPanelItem Value="AccountInformation" runat="server">
                                            <telerik:RadDatePicker ID="RadDatePicker1" Width="200px" runat="server" MinDate="1900-01-01"
                                                <Calendar ID="Calendar1" RangeMinDate="1900-01-01" runat="server">
                                            <telerik:RadDatePicker ID="radDtHiredate" Width="200px" runat="server" MinDate="1900-01-01"
                                                <Calendar ID="calHire" RangeMinDate="1900-01-01" runat="server">
                                            <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="validatehiredate"
                                                SetFocusOnError="true" ControlToValidate="RadDatePicker1" ValidationGroup="accountValidation"
                                              ForeColor="Red"  Display="Dynamic">Can not Hire Guy less than 18 yrs</asp:CustomValidator>
                                            <br />
                                            <button onclick="javascript: NextDay(event); return false">
                                                Move to next day</button>
                                            <telerik:RadButton ID="rdbtnpersonalSaveNext" ValidationGroup="accountValidation"
                                                OnClick="rdbtnpersonalSaveNext_Click" TabIndex="11" runat="server" Text="Save & Next">
                <telerik:RadPageView ID="rdpgContact" runat="server">
                    <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="FullExpandedItem"
                        Skin="Vista" EnableEmbeddedSkins="false" Width="880px">
                            <asp:TextBox ID="txtDemo" runat="server">
                        Demo Contact

    When I click on second Tab and came back to first tab the custom validation which i had written fails, can some one help me..

    <telerik:RadCodeBlock runat="server" ID="radcb">
                <script type="text/javascript" language="javascript">
                    function monthDiff(d1, d2) {
                        var months;
                        var date1 = new Date(d1);
                        var date2 = new Date(d2);
                        return (date1 - date2) / (1000 * 60 * 60 * 24);
                        return months;
                    //function getLeapYear
                    function difference(d1, d2) {
                        var diff = 18 * 12;
                        var Age = monthDiff(d1, d2);
                        var compareVal = 365 * 18; //getCompareVal(hiredate,dob);
                        if (Age >= compareVal) {
                            return true;
                        } else {
                            return false; //false
                    function validatehiredate(value, arg) {
                        var datePicker = $find('<%= rdpnlPersonal.FindItemByValue("AccountInformation").FindControl("radDtHiredate").ClientID %>');
                        var datePicker1 = $find('<%= rdpnlPersonal.FindItemByValue("AccountInformation").FindControl("RadDatePicker1").ClientID %>');
                        var date = datePicker.get_selectedDate();
                        var date1 = datePicker1.get_selectedDate();
                        arg.IsValid = (difference(date, date1));
  2. Dimitar Terziev
    Dimitar Terziev avatar
    1266 posts

    Posted 02 Jul 2012 Link to this post


    I've made a sample page using the provided implementation trying to reproduce the experienced problem, but to no avail. Here is a video of my tests. In order to troubleshoot this issue, open a support ticket and provide a runnable sample page so we could test and debug it locally.

    Kind regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top