Simple Membership Plugin › Forums › Simple Membership Plugin › Phone number validation
Tagged: phone number, validation
- This topic has 3 replies, 3 voices, and was last updated 1 year, 2 months ago by
JJaabbmm.
-
AuthorPosts
-
August 29, 2022 at 3:26 pm #24338
Nicole Rosset
ParticipantHello,
When I add a new member through the “Add a member” of the basic part of the plugin, I can specify a phone number with spaces in it : ex : 021 621 21 21, but when I edit the profile later with the Membership Form Builder, the phone number is refused until I get rid of all the spaces.
Is there a way to specify which phone number format I allow ?
Thank you very much in advance
Nicole RossetAugust 30, 2022 at 1:08 am #24342admin
KeymasterIf you want to allow space or other characters in the field where you will collect phone number, use a standard text field (instead of a phone number type field). A text field will accept any characters. You can call this text field “Phone Number”.
Also, please note the following when you are manually adding a member record from the admin interface while using the form builder addon:
With the Form Builder, the custom form and the fields of a member depend on the membership level. So when you want to manually add a record via the admin interface, you need to add the user with some minimal info and set a membership level and then save the profile. When you edit that profile again, it will show the custom fields option this time (since it will be able to load the fields based on the membership level).
When you want to edit a member’s profile, if you change the membership level, then you have to remember that the custom fields will change based on the new membership level that you are giving that profile. So if you want to manually change the membership level, you need to change the membership level first and save the profile. Then edit the profile again so the custom fields template is loaded according to the new level that you have assigned to that profile. Now, you can make changes to the custom field values of that profile and save it.September 2, 2022 at 4:58 pm #24367Nicole Rosset
ParticipantHello,
Thank you very much for your quick et precise answer.
Thank you for the very clear explanations about the custom fields and membership level.
I thougt about using standard fields for the phone number and the address (because those basic fields don’t really suit my needs). I tried, but then I noticed that the basic fields phone and address were still there and that my custom standard fields were additional fields, that appeared later in the admin interface.
So I thought it was confusing to see empty fields first for the phone number and the address in the admin interface.
So I reverted back to the basic fields. And I was hoping to live with the basic fields if only I could find a way to specify the phone format I need. Which doesn’t seem to be the case.
Thank you very much
Keep on the good work, take care
Nicole RossetJanuary 24, 2025 at 12:31 pm #29472JJaabbmm
ParticipantWhat worked for me was using a simple phone number validation rule that trims spaces automatically. I also set a specific format to make sure the number is accepted every time, like the international format without spaces. As for allowing specific formats, I think you can use a plugin or script to enforce that—something like the US phone number for verification format could be a good starting point. I’ve used a service like that before, and it made things a lot smoother.
-
AuthorPosts
- You must be logged in to reply to this topic.