Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.1ruby-on-rails-3.2client-side-validation

How to use rails with both disable_with and client_side_validations


I am using Rails 3.2.8 and the excellent client_side_validations gem and would also like to use the rails disable_with option on my submitbutton on a form. Problem is, client_side_validations is not run until the user clicks the submitbutton and if there are input errors (i.e. an inputfield left blank by accident), rails by then has already disabled the submitbutton because the user clicked submit, meaning the user cannot submit the form after correcting the errors.

Does anybody have a good solution?

Thanks :)


Solution

  • If you upgrade to the 3.2 version of ClientSideValidations I have just released it now supports :disable_with