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

Validation for each page not work in client side

3 Answers 67 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Akhil Raj
Top achievements
Rank 1
Akhil Raj asked on 27 May 2010, 10:21 AM
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?

 

 

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 01 Jun 2010, 10:59 AM
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.
0
Akhil Raj
Top achievements
Rank 1
answered on 02 Jun 2010, 05:08 AM
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
0
Veronica
Telerik team
answered on 07 Jun 2010, 02:32 PM
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.
Tags
TabStrip
Asked by
Akhil Raj
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Akhil Raj
Top achievements
Rank 1
Share this question
or