4

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.

4

2 回答 2

1

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.

于 2013-07-18T07:02:10.073 回答
0

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

于 2016-09-22T10:42:10.723 回答