本文介绍了Rails的客户端验证 - 不允许提交,直到验证通过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
标题是不言自明。我使用在轨客户端验证和它的作品奇妙。不过,我不希望提交我的窗体上按钮启用,直到所有的验证通过。
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.
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
有回调函数:
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
.
这篇关于Rails的客户端验证 - 不允许提交,直到验证通过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!