I have a created a webform for account entity with some steps.
In the last step while submitting the form I have ajax code to add a record for my custom entity with account id.
The ajax request is failing because of page refreshing. I want to stop the page refresh or page redirecting until my custom entity's record is saving.
I have added following code:
if (window.jQuery) { (function ($) { if (typeof (webFormClientValidate) != 'undefined') { var originalValidationFunction = webFormClientValidate; if (originalValidationFunction && typeof (originalValidationFunction) == "function") { webFormClientValidate = function() { originalValidationFunction.apply(this, arguments); return true; }; } } }(window.jQuery)); }
I have added the above code in my last step as custom JavaScript but code doesn't work because webFormClientValidate is getting undefined. Wherever I place this code webFormClientValidate getting undefined.
any suggestion?