Permalink
Browse files

Merge pull request #454 from kirel/v3.2.1-configurable-validatable-in…

…puts

Make configurable which inputs validateForm will validate
  • Loading branch information...
bcardarella committed Jan 3, 2013
2 parents 12ab764 + a2e2c2a commit 1f07ef08ff478f054f52daa507a1e949b76ecaab
Showing with 4 additions and 2 deletions.
  1. +2 −1 coffeescript/rails.validations.coffee
  2. +2 −1 vendor/assets/javascripts/rails.validations.js
@@ -42,7 +42,7 @@ validateForm = (form, validators) ->
form.trigger('form:validate:before.ClientSideValidations')
valid = true
- form.find(':input:enabled:visible[data-validate]').each ->
+ form.find(ClientSideValidations.selectors.validate_inputs).each ->
valid = false unless $(@).isValid(validators)
# we don't want the loop to break out by mistake
true
@@ -107,6 +107,7 @@ if window.ClientSideValidations.forms == undefined
window.ClientSideValidations.selectors =
inputs: ':input:not(button):not([type="submit"])[name]:visible:enabled'
+ validate_inputs: ':input:enabled:visible[data-validate]'
forms: 'form[data-validate]'
window.ClientSideValidations.reset = (form) ->

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

1 comment on commit 1f07ef0

@1st8

This comment has been minimized.

Show comment Hide comment
@1st8

1st8 Jan 8, 2013

very important! thanks

1st8 commented on 1f07ef0 Jan 8, 2013

very important! thanks

Please sign in to comment.