Formating Phone Number (555) 555-5555

Mehr
4 Jahre 6 Monate her #97472 von PRO_HENAU
PRO_HENAU erstellte das Thema Formating Phone Number (555) 555-5555
I'd like to have the person taking the survey enter their phone number in the follwing format:

(555) 555-5555


I am placing the following code:
((?:\(\d{3}\)\s*\d{3}-\d{4})

Here is the question information:

Code: Employee_Phone : (Mandatory question)
Question: What is your phone number?
Help: Please provide the best number to contact you.
Validation: ((?:\(\d{3}\)\s*\d{3}-\d{4})
Type: Numerical input
Mandatory: Yes

The results are a red box that does not validate.

I'm brand new to all this and have been trying to read and follow directions, but I can't seem to figure this out.

Thanks.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 6 Monate her - 4 Jahre 6 Monate her #97479 von actxcellence
actxcellence antwortete auf das Thema: Formating Phone Number (555) 555-5555
My pragmatic solution would be:
Do not validate this information.
think twice before you bother your users with double constraint input, if not essential for the project. It could be the moment when a user decides to discontinue the survey.

someone might want to be precise and helpful and enters: (555) 555-5555 till 2pm, then dial 555-5545
why punish them?

I can't help with a technical solution

may be this helps:
www.freeformatter.com/regex-tester.html

Schon die Bedienungsanleitung von LimeSurvey angeschaut?
Bedienungsanleitung (DE) | Tricks, um mehr Antworten auf Fragen im Forum zu erhalten
Letzte Änderung: 4 Jahre 6 Monate her von actxcellence.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 6 Monate her #97502 von tpartner
tpartner antwortete auf das Thema: Formating Phone Number (555) 555-5555
You could put a mask on the question - digitalbush.com/projects/masked-input-plugin/

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
4 Jahre 6 Monate her #97515 von DenisChenu
DenisChenu antwortete auf das Thema: Formating Phone Number (555) 555-5555
Hello,

You CAN NOT validate such mask with "numeric question" type.

It's not numeric but text: 1st : use text question type and test again.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha