Title is self-explanatory. I am using client side validation in rails and it works wonderfully. However, I don't want the submit button on my form to be enabled until all the validations pass.
Any help would be appreciated.
Title is self-explanatory. I am using client side validation in rails and it works wonderfully. However, I don't want the submit button on my form to be enabled until all the validations pass.
Any help would be appreciated.
There are callback functions:
ClientSideValidations.callbacks.form.pass(form, eventData)
ClientSideValidations.callbacks.form.fail(form, eventData)
You can disable the submit button by default and on fail
. and enable it on pass
.
In case somebody more recent comes along looking for an answer to this, Alexey's answer is pretty much correct. Currently, there are callbacks available on the elements that you could use.
https://github.com/DavyJonesLocker/client_side_validations#callbacks