I\'m using parsley.js in a USP Pro form in Wordpress. The validation works, in general, but now I\'m trying to validate the max file size and I don\'t really understand how to d
There are a few remarks:
input[type=file]
by default. Just for this, your code is never executed.parsley-filemaxsize
instead of data-filemaxsize
I've managed to tweeak the code, and the solution is below. You can also check the working jsfiddle.
Please be aware: I've spent some time trying to convert this code into Parsley 2.* . However, I don't think you can use Parsley 2.* since the Custom Validators only recieve the value and the requirement and you need the parsleyField.$element to verify the file size.