How to reenable formio submit button?

Viewed 2522

I'm using formio with angular to render a custom form I've built - https://help.form.io/developer/info/angular/

I'm using the following to catch the submission and call my own logic, however the submit button stays disabled. I'm not actually using the formio server side so how do I re-enable the submit button without changing the source code? Is there an undocumented event for form submission success? I've tried also binding to 'formSubmission' event.

$scope.$on('formSubmit', function(err, data) {
    event.preventDefault();
    submitForm();
}
2 Answers

if you are using pure javascript, trigger the event with "emit" and intercept with "on", try this

 formio.emit('submitError', res);// formio.emit('submitError', res);

The button with red background will be displayed by default enter image description here

To intercept the event triggered by the emit, do the code below

formio.on('submitDone', function(res) { /*your code here*/ }
Related