Required field on step back

4 posts, 0 answers
  1. Yan
    Yan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 17 Oct Link to this post

    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
  2. Yan
    Yan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 19 Oct Link to this post

    or is it possible to set CausesValidation=false for the previous button?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Yan
    Yan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 19 Oct Link to this post

    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.

     

     

  5. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    287 posts

    Posted 20 Oct Link to this post

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