Hello,
I’m using s2Member Pro and I created a custom registration field for phone number . The problem is that the built-in validation forces exactly 10 digits , which only works for US numbers.
In my case, users can register from different countries (Brazil, Europe, etc.), so I need the phone field to:
- Accept variable length (not only 10 digits).
- Accept the “+” sign at the beginning for international dialing codes.
- Ideally allow common characters like spaces, hyphens, and parentheses.
I already tried changing the field type in General Options → Registration/Profile Fields , but it still validates against the 10-digit US pattern. I also tried overriding with a custom regex in PHP, but the JavaScript validation on the frontend keeps blocking submissions.
Question:
Is there a recommended way in s2Member to make the phone field validation more flexible (international format)?
Maybe through a hook/filter, or by disabling the default phone validation rule?
Any guidance or example code would be very much appreciated.
Thank you!
Jónior de Faria Antunes