0

I am building an application web form, I have created a choice field that will have the application status (Approved, denied, Under review, etc) and I would like to add a custom JavaScript code to update to a different value after the users click in submit button (final step) in the multi-step form, checking MS documentation https://learn.microsoft.com/en-us/power-pages/configure/add-custom-javascript but not sure who to do it in my case, any recommendations on who may I write this code? below you have an example of what I have tried with no success.

Thank you

if (window.jQuery) {
   (function ($) {
      if (typeof (entityFormClientValidate) != 'undefined') {
         var originalValidationFunction = entityFormClientValidate;
         if (originalValidationFunction && typeof (originalValidationFunction) == "function") {
            entityFormClientValidate = function() {
               originalValidationFunction.apply(this, arguments);
               // do your custom validation here
               // return false; // to prevent the form submit you need to return false
               // end custom validation.
                 $('#lts_applicationstatus').val(857230001);
               return true;
            };
         }
      }
   }(window.jQuery));
}

0 Answers0