latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

s2member custom field.The phone number length

Home Forums Community Forum s2member custom field.The phone number length

This topic contains 9 replies, has 3 voices. Last updated by  Cristián Lávaque 3 years, 8 months ago.

Topic Author Topic
Posted: Sunday Apr 7th, 2013 at 11:23 am #46802

Hi!

I have to add a phone number custom field to the registration form. But the parser only is allowed to enter 10 digits exactly, brackets and hyphens. For me it’s a problem. Usually, europeen phone numbers are started with plus (“+”) and can contain 10 or 11 or 12 digits depending on country, and, of couse, optionally brackets and hyphens.
What should I change that phone number parser can accept my clients phone numbers.

Thank you in advance.
Best regards. Sergios

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Monday Apr 8th, 2013 at 4:19 pm #46862

Still waiting for answer.

Posted: Tuesday Apr 9th, 2013 at 8:08 pm #46957
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

We appreciate your patience. Unfortunately s2Member does not take into account all of these possibilities. I’d recommend instead just allowing for 10 or more numerical characters for the time being. I’ll have our development team look into adding further possibilities in the future.

Posted: Wednesday Apr 10th, 2013 at 5:59 am #47050

Hi Bruce!
Could you please tell me where a parser is? I’ll try to add another rule for phone nembers like +xxx(xx)xxx-xx-xx where country code can be 1, 2 or 3 digits. I think, a lot of people needed this rule.

Best regards. Sergios

Posted: Wednesday Apr 10th, 2013 at 6:17 pm #47119
Bruce
Username: Bruce
Staff Member

Could you please tell me where a parser is? I’ll try to add another rule for phone nembers like +xxx(xx)xxx-xx-xx where country code can be 1, 2 or 3 digits. I think, a lot of people needed this rule.

You’re looking for /s2member/includes/s2member.js, I believe.

Posted: Thursday Apr 11th, 2013 at 1:25 pm #47208

Hi Bruce!

I tried to make some changes in code /s2member/includes/s2member.js, but there is no reaction.
I tryed to restart and change browser, http server. Nothing happend. Please advice.

Best regards. Sergios

Posted: Friday Apr 12th, 2013 at 6:17 pm #47336
Bruce
Username: Bruce
Staff Member

I tried to make some changes in code /s2member/includes/s2member.js, but there is no reaction.
I tryed to restart and change browser, http server. Nothing happend. Please advice.

s2Member uses a minified version of this file (s2member-min.js). You’ll need to either rename the file to that name and overwrite the current one, or minify your copy and replace the old copy with your new. I would recommend the latter.

Posted: Tuesday Apr 23rd, 2013 at 1:44 pm #48202

Hi Bruce!

I’v changed phone number parsing line to

else if (expected === 'phone' && (!value.match (/^\+*[0-9 \(\)\-]+$/) || value.replace (/[^0-9]/g, '').length < 8 || value.replace (/[^0-9]/g, '').length > 12))

At the moment, the numbers, starting with + and contained 8-12 digits are valid
Best regards. Sergios

Posted: Tuesday Apr 23rd, 2013 at 3:29 pm #48211

Hi!

Another question. How can I keep my changes in code when s2memeber is updated to a new version? I know how to do it with a theme (child-theme) but I do not know with plugins.

Please advice.
Best regards. Sergios

Posted: Wednesday Apr 24th, 2013 at 6:36 am #48270

Another question. How can I keep my changes in code when s2memeber is updated to a new version? I know how to do it with a theme (child-theme) but I do not know with plugins.

Have the edited copy of the file outside the s2member directory, put it in the must-use plugins one. /wp-content/mu-plugins/

Viewing 9 replies - 1 through 9 (of 9 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.