• Resolved athomas5

    (@athomas5)


    I’m using the Woocommerce plugin and added a custom phone number user field. The phone number gets validated (10 digit number without special characters) correctly on the registration and checkout page. However, the user can enter any values on the my-account/edit-address/billing page. How can I hook into this process and only allow the user to enter a valid phone number when updating their profile.

    I searched and tried various hooks but none of them seem to work as intended.

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Depending on how you added those input fields, you should be able to ensure the input field type is set to “number” with a regex pattern as part of the input attributes (this is HTML5 specific as far as I know). With that place, the validation will be built into the browser and no Javascript-powered validation is required.

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Validate phone number on edit address page’ is closed to new replies.