I’d like to set the form’s submit button to disabled after the form has successfully submitted its data. The button should be disabled and not respond to further clicks, so I’m referring to the disabled attribute, not the disabled class. I followed a tute here which disabled the button while “executing” but want it to also be disabled after the data has been successfully submitted so the user cannot resubmit it.
I tried to do it by turning the form’s ‘Success’ event where I already have a notification displayed into an inline event and then running an action: “formssa.btn3.disable(-1)” and also tried “formssa.btn3.disable(true)”. Neither worked.
Any ideas how to do this simple action?
Could you maybe screen shot your forms structure and what you entered for the buttons dynamic disabled, just to add the code I sent above would have needed to be entered in code not design in the bind menu
Your form points to an API file. In that file use a set value step, give it the name ‘complete’ and a value of 1. Make sure you tick the output option.
The form on your page should have an id. Something like serverconnectform1 so your disabled attribute would be state.executing || serverconnectform1.data.complete == 1
I use the click event to trigger some validations, examine the results, and then call form.submit.
I don’t think it would interfere with the disabled event.
I see what you are saying. Is there a way to cancel the click event within the flow? Then I suppose if validations passed I could do nothing further and the form would submit.
I just tested using a flow on the submit buttons click on a test and for me this disabled the button. After disabled the flow shouldn’t run at all wasn’t sure if this was how flows worked but don’t think the click event is the issue.
The only other thing I can possibly think is if the form is in a conditional region or something is editing the bind from status == 200 to my_conditional_region.status == 200
Maybe the community will have other suggestions this method is working in my tests not sure what the difference is