Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You have a new customer registration Form (A) that is normally forwarded to Forms B and C to complete registration for a new user registration. Returning Users skip Form B and go directly to form C.  A  workflow with a precondition that skips a step or a templatized value of a control to decide where the user should be forwarded using Business Rules are recommended approaches and should be considered. This JavaScript allows the user to bypass a form when it is not required and can be used if the recommended approaches are not possible. Add a control to your form with a It will automatically submit a form if a certain control has some specific value (say “not-new”) in it. The value of this control will be compared to determine if the form should be automatically submitted

Code Block
var CustomEventHandlers = {
   submitEl: null,
   setup: function (el) {
       if (CustomView.hasClass(el, 'conditional-submit')) {
           window.setTimeout('CustomEventHandlers.conditionalSubmit()', 2000);
           this.submitEl = el;
       }
   },
   conditionalSubmit: function () {
       var isValue = "not-new";
       if (this.submitEl.value == isValue) {
           SubmitView.doSubmit("Submit");
       }
   },
}

...