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

Required field on step back

3 Answers 35 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Yan
Top achievements
Rank 1
Yan asked on 17 Oct 2016, 07:26 PM
Hi,  in my radwizard,  I have multile steps with different groups.  I try to find a way to bypass the validation when I press "previous" button.  There is no way I can hit previous without my required field validator interrupting me.

I found a thread where you ask to add the following javascript :
function OnClientButtonClicking(sender, args) {
                if (sender.get_activeIndex() > args.get_nextActiveStep().get_index()) {
                     args.set_cancel(true);
                     sender.set_activeIndex(args.get_nextActiveStep().get_index());
                 }
            }
When I debug,  I can see the script is called but there is something else preventing the page from going to the previous one.  Required field validator kicks in as soon as I hit previous.
Thank you for your help

3 Answers, 1 is accepted

Sort by
0
Yan
Top achievements
Rank 1
answered on 19 Oct 2016, 01:20 PM
or is it possible to set CausesValidation=false for the previous button?
0
Yan
Top achievements
Rank 1
answered on 19 Oct 2016, 05:08 PM

ok i've got more information but it stills does not work as intended.  If the wizzard is purelu client side,  required field is not trigger when I hit previous.

 

the problem is if I have a code behind trigged when I clic previous,  the required field kicks and I can't get to previous step.

if I handle OnActiveStepChanged on the code behind,  there is no way I cant prevent the required field from triggering.

 

 

0
Veselin Tsvetanov
Telerik team
answered on 20 Oct 2016, 10:01 AM
Hello Yan,

The required field validation will be triggered on each postback of the page. Therefore, when you trigger a server event the required field validation will be triggered for the fields on your current step.

If you want to keep Previous click clear from validations, I would suggest you handle the navigation between steps on client, as demonstrated on the following demo.

Regards,
Veselin Tsvetanov
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Tags
Wizard
Asked by
Yan
Top achievements
Rank 1
Answers by
Yan
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or