Okay - let me do better splain'en.
On the form_x.js - I am updating a value if a certain submit button is pressed. The problem is that with this JS code - the elements will be updated even if the form validation fails. Wondering if there is a way to only update these values until after validation is successful?
On the form_x.js - I am updating a value if a certain submit button is pressed. The problem is that with this JS code - the elements will be updated even if the form validation fails. Wondering if there is a way to only update these values until after validation is successful?
JavaScript:
requirejs(['fab/fabrik'], function() {
Fabrik.addEvent('fabrik.form.submit.start', function (form, e, btn) {
if (btn.name === 'Route To Manager') {
form.formElements.get('itr_2___routing_flag').update('1');
}
else if (btn.name === 'Route for App_Imp') {
form.formElements.get('itr_2___routing_flag').update('2');
}
});
});