jQuery validator modified to validate non inputs

jQuery validator 1.9.0 modified download

To use just add a custom validator and validateable="true" to a non input element and it should apply any custom validators you've created.

e.g.
<script>
$.validator.addMethod(
  "groupnotnull",
  function(value, element) {
   return $("input[type='text']:filled",element).length!=0;
  },
  function(regexp, element) {
   return "At least one input must be specified";
  }
);
</script>

<div validateable="true" name="groupValidated" groupnotnull="true">
  <input type='text' name="foo"/>
  <input type='text' name="blah"/>
</div>








© 2009 - Email matsondawson@gmail.com for more information.