I'm using JQuery Validate plugin to validate if an input contains any spaces or not (No spaces are allowed).
I've tried pattern
rule from the additional-methods.js
file but it doesn't work at all:
"fos_user_registration_form[plainPassword][first]": {
required: true,
minlength: 6,
pattern: "/^\S*$/"
},
And tried the solution here
"fos_user_registration_form[plainPassword][first]": {
required: true,
minlength: 6,
regex: "/^\S*$/"
},
Bit still it doesn't fire at all when, for example, I type "this is test".