guillaumepotier/Parsley.js — pull request #458 by hwsoderlund (2013-12-10 20:16:11+00:00)
Title: Two suggested fixes

First of all, thanks for an excellent library. A couple of suggested fixes:

1. Allow both 'pattern' and 'parsley-regexp' to be set but the latter to override the former. There is more information in the commented code about my reasoning behind this.

2. The scenario: I had created a custom validator to validate e-mail addresses. The validator first checks the format of the address. Once the address has the correct format an ajax request is made to the server to make sure the address is not already registered.
The problem: If a field was first set to invalid due to an incorrect format and then later set to invalid again, but this time with another error message ("e-mail address already registered"), the message would not be updated in the UI.
My fix makes sure that an error message is always updated even if the isValid (or whatever) parameter remains unchanged. I suppose you may want to solve this in a different way, such as changing the addError method instead of adding an updateError method like I did. Your choice.

It would be great if you could merge these fixes, or possibly improved versions of them, into the next parsley.js release.

Regards,
/Henrik