Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created November 26, 2012 07:46
Show Gist options
  • Save jacobh/4147072 to your computer and use it in GitHub Desktop.
Save jacobh/4147072 to your computer and use it in GitHub Desktop.
jQuery validator plugin modification to allow for multiple inputs with the same name, ported to CS
$.validator::checkForm = ->
@prepareForm()
elements = (@currentElements = @elements())
for element in elements
$elem = $ "[name='#{element.name}']:not([disabled])"
if $elem.length > 1
for sub_element in $elem
@check sub_element
else
@check element
@valid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment