Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<input type="text" data-parsley-multiple="3" data-parsley-error-message="Please try again" />
/*...*/
<script type="text/javascript">
window.ParsleyValidator
.addValidator('multipleof', function (value, requirement) {
return 0 === value % requirement;
}, 32)
.addMessage('en', 'multipleof', 'This value should be a multiple of %s');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment