How do I add the attr:data-parsley-pattern=\"\"
tag correctly to a input?
I wrote this:
Your code seems to work perfectly here: http://jsfiddle.net/c2r4R/
What you need to know: Parsley validates only empty required fields. Your data-parsley-pattern
directive is not applied if field is left empty. You'll need to add a required
tag in order to throw an error if field is left empty, and throw another pattern error if field do not match your serial number pattern.
Best