Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Formating Phone Number (555) 555-5555

Formating Phone Number (555) 555-5555 9 Monate 3 Wochen her #97472

  • PRO_HENAU
  • PRO_HENAUs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 1
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Formating Phone Number (555) 555-5555 9 Monate 3 Wochen her #97479

  • actxcellence
  • actxcellences Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 37
  • Dank erhalten: 7
  • Karma: 0
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: 9 Monate 3 Wochen her von actxcellence.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Formating Phone Number (555) 555-5555 9 Monate 3 Wochen her #97502

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3813
  • Dank erhalten: 683
  • Karma: 328
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Formating Phone Number (555) 555-5555 9 Monate 3 Wochen her #97515

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 5850
  • Dank erhalten: 716
  • Karma: 222
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.150 Sekunden
Donation Image