powermail
powermail copied to clipboard
wrong client validation message when field is combined with required and regexp pattern
Original error
Hello, I have a question about the javascript validators. it is a field of type input
- it is required and
- is checked using the regexp pattern Wrong behaviour: you click in the field, enter wrong data. the pattern error message is displayed. In the second step, delete the data and enter correct data. The error message disappears. In the third step, delete the input. Now that the field is empty, the “required” error message is expected, but the regex pattern error message appears. Expected behaviour: After, content has been removed and the field is empty, the “required” error message should appear. It seems that the “regexp” error message always wins.
- Can I change the priority?
- Is it possible to display several error messages at the same time?
TYPO3 8.7.30 powermail 7.0.0
After some investigations:
I think it has something to do with the underlying parsely library.
here the function _manageErrorsMessages is run through and it only checks if the current field has an error message "this.options.errorMessage" and prints it out.
Since the vh:Validation.ValidationDataAttribute sets viewhelper in HTML data-parsley-required-message and data-parsley-error-message. The data-parsley-error-message always wins here.
Although the parsely check fails on required, it displays the data parsley error message.
Can you reproduce this? I can make my ddiv available via ngrok to demonstrate.
i could reproduce this behavior also in following setups TYPO3 9.5.14 powermail 7.0.0 and powermail 7.4.0
wants to test it on TYPO3 10.2.2 but while issue https://github.com/einpraegsam/powermail/pull/504 exists. it not possible to work with.
i could also reproduce this behavior also in following setups
TYPO3 10.2.2 powermail 8.0.2
and TYPO3 10.3.0 powermail 8.0.2