Validation for each page not work in client side

4 posts, 0 answers
  1. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 27 May 2010 Link to this post

    hi ,
      I have tabstrip with 2 pageview. I need to put validation controls for pages. I seperate each page with validationgroup and change validation group in OnClientTabSelected . The logic i used is from the following topic
    http://www.telerik.com/community/forums/aspnet-ajax/tabstrip/update-validation-group-rad-tabstrip.aspx

    So my client function is:

     

    function UpdateValidationGroup() {   
     var tabStrip = $find("<%= Radstrip1.ClientID %>");   
     var selectedTab = tabStrip.get_selectedTab();   
     if (selectedTab != null)   
     tabStrip.ValidationGroup = selectedTab.get_value();  
    alert(tabStrip.ValidationGroup);  
     
    }   
     
     
     


    in the alert box itself i got the changed value in tabstrip. But validation happening when tab changed. If i use serverside function in onTabClick and set the group the validation works fine. What i missed when process from client side?

     

     

  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 01 Jun 2010 Link to this post

    Hello Akhil Raj,

    I could not understand what you mean by "But validation happening when tab changed". Could you please explain more about what the problem is in the code or send me a sample project so we can help you?

    Thank you.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 02 Jun 2010 Link to this post

    hi admin,
        i have seperate validation group for each tab page. So when i change the tab page validate the current group and change the tab. Again i need to validate that page as separate group. I think you got my scenario. In tabstrip we have one validationgroup for entire tabstrip not for each page. So when i change the tab page i need to set the validationgroup to the group assigned to that page. Hewre i used tab value as validation group of each tab.

     When i set the validatgion group of tabstrip by onTabStrip server event, it perfectly set the new tab value so i can validate the current tab. But if i set this validation group using client side, validationgroup not changed. Why?
    I used the client function in onClientTabSelected and my fucntion code is in my first post
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 07 Jun 2010 Link to this post

    Hello Akhil Raj,

    Thanks for the detailed explanation. I've created a sample project by your description with two PageViews and I used your client code to try to change the ValidationGroup of the RadTabStrip. I've subscribed to the OnClientTabSelected event.

    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1"
                OnClientTabSelected="UpdateValidationGroup" CausesValidation="True" SelectedIndex="0">

    The only thing I've changed is marked in yellow in the code below:

    function UpdateValidationGroup(sender, args) {
                var tabStrip = sender;
                var selectedTab = tabStrip.get_selectedTab();
                if (selectedTab != null)
                    tabStrip.ValidationGroup = selectedTab.get_value();
                alert(tabStrip.ValidationGroup);
            }

    Now the code is running correct. After you select a tab - alert appears with the correct name of the ValidationGroup.

    Find the full code in the attached .zip file and please let me know if this was helpful.

    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.
Back to Top