[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • Last Modified:

tabstrip validation

I am using telerik tabstip that I set the causesvalidation = true for the tabs , what it happens, when I go forward withought entering required fields my validation required fields fires up and not let me go forward so it is good, but if I go all the way last tab that time and want to come back and change something on the first tab , validation not firing that time if I take out something and leave for ex, firstname textbox empty,,, because orginaly if was not empty maybe thats why?
0
1jaws
Asked:
1jaws
  • 7
  • 6
1 Solution
 
sunithnairCommented:
Set a validationgroup for your validationcontrols and controls to validate
0
 
1jawsAuthor Commented:
i do have that validationcontrols for my each pageview
0
 
1jawsAuthor Commented:
thats why it is ok validation works forward, but it you clcik on previous tabs and change somehing leave textbox empy for example, it is not validating that time..
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
1jawsAuthor Commented:
on step 1  txtfirstname, txtlastname and two required field validators for them.

2 step txtcredti card number

3 step something else textboxes.

what happens first time if I dont fill the 1 step textboxes validation code works, then I go next step fill those credit card textbox fields then go to 3 step right, When On step 3, I decided to go back to Step 1 and changed my lastname to (nothing) empty and clcik back on the Step2 tab, it does lets me even though lastname field is empty...
<telerik:RadTabStrip ID="radTabs" runat="server" 
    MultiPageID="radPages"     SelectedIndex="0"    
    causesvalidation="true"> 
 
 
 
 
    <Tabs> 
 
 
 
 
    <telerik:RadTab runat="server" Text="Step 1"  >
    </telerik:RadTab> 
 
 
 
 
        <telerik:RadTab runat="server" Text="Step 2" >
        </telerik:RadTab> 
 
 
 
 
        <telerik:RadTab runat="server" Text="Step 3" >
        </telerik:RadTab>
 
    </Tabs>
</telerik:RadTabStrip> 

Open in new window

0
 
1jawsAuthor Commented:
I added validationgroup to tabstrip, it works if I had one just vg1 for all, but since Ihave three different validationgroup I dont know how to set that up, each view has own validationgroup vg1, vg2, vg3
0
 
sunithnairCommented:
Have you tried setting the ValidationGroup as I mentioned earlier and shown in this example http://demos.telerik.com/aspnet/TabStrip/Examples/ASPNET2/ValidationGroup/DefaultCS.aspx. This example has almost the same scenario as yours and it works fine.
0
 
1jawsAuthor Commented:
ok, on that second tab what would be validationgroup = same as first one, because I had vg1 for first one, vg2 and vg3 .. so if I put  ValidationGroup="TabStripValidationGroup" to tabstrip what I need to do for the rest , put same thing for instead of vg2 and vg3?
 
0
 
sunithnairCommented:
0
 
sunithnairCommented:
If none of that works you could try this on the server side Page.Validate(vg1)
0
 
sunithnairCommented:
0
 
1jawsAuthor Commented:
I have decided to turn off the steps clickable but I dont know how to do that. What I do that I set the eaach tabs to enable =  false at the begining than as I go along on the button Next I enable them by one by. But I want like this, Step1 already enable one( I did that by setting step 1 enable = true) , Step 2 and 3 is enable false. When user on step1 and hit next button goes to Step2  at that point I need step1 to be enable false , then same thing for when user goest to step3 , step 1 and step2 should be enable =false
how can I do that
0
 
sunithnairCommented:
Can you try adding a disabled attribute like this step1.Attributes.Add("disabled", "true")?
0
 
1jawsAuthor Commented:
thank you so much it worked..
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now