You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Entering too few digits, even if all digits are numbers, for a valid phone number will display in a confusing error message of "Phone Number must consist of only numbers".
Explanation
The validation is looking for 12 characters. If it can't find 12 it sets the entire input to an empty string. This causes the regex validation to fail and the code execution continues to an error message intended for input that contained something other than numbers.
Solution
We just have to update the validation check to fail with a valid error message.
Steps to Reproduce
Set the phone format in the test Mailchimp account (/lists/settings/merge-tags) to US style
Select the "Update List" button to refresh the Mailchimp data with WP
Include the Phone Number merge field in the Mailchimp settings
Submit a form submission with one digit less in any input
Describe the bug
Entering too few digits, even if all digits are numbers, for a valid phone number will display in a confusing error message of "Phone Number must consist of only numbers".
Explanation
The validation is looking for 12 characters. If it can't find 12 it sets the entire input to an empty string. This causes the regex validation to fail and the code execution continues to an error message intended for input that contained something other than numbers.
Solution
We just have to update the validation check to fail with a valid error message.
Steps to Reproduce
Screenshots, screen recording, code snippet
phone-number-missing-digits-displays-wrong-validation-message.mov
Environment information
No response
WordPress information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: