Navigation Menu

Skip to content

Commit

Permalink
Fix for checkboxes immediately unchecking when validated
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmac committed Jan 27, 2012
1 parent 96bb45b commit f524188
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
6 changes: 5 additions & 1 deletion coffeescript/rails.validations.coffee
Expand Up @@ -43,7 +43,11 @@ $.fn.validate = ->
}

# Checkboxes - Live events don't support filter
form.find('[data-validate="true"]:checkbox').live('click', -> $(@).isValid(settings.validators))
form.find('[data-validate="true"]:checkbox').live('click', ->
$(@).isValid(settings.validators)
# If we don't return true here the checkbox will immediately uncheck itself.
return true
)

# Inputs for confirmations
form.find('[id*=_confirmation]').each ->
Expand Down
13 changes: 2 additions & 11 deletions vendor/assets/javascripts/rails.validations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f524188

Please sign in to comment.