Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: How to add regular express validation in short text input field?

How to add regular express validation in short text input field? 4 years 10 months ago #73464

  • sammy
  • sammy's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Karma: 0
Is add into 'Validation' ? if so, the regular express will display as attach screen? How to hidden it ? Thanks
Attachments:
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73468

  • Steve01
  • Steve01's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 493
  • Thank you received: 47
  • Karma: 17
Hello,

which LimeSurvey version do you use? LimeSurvey 1.92RC1 or 1.92RC2? We had a discussion at www.limesurvey.org/de/forum/development/...-in-validation-field and it came to the point whhere we discussed if this messages should be hidden. If I'm correct TMSWhite fixed/updated it in LimeSurvey 1.92RC3 (or a few build after this release candidate) so it might be a good idea to update your/install a new LimeSurvey installation.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73475

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
In 1.92 RC4, we have eliminated the display of the regular expression validation message, since we figure very few people would understand it. Instead, if people want to guide users, they can put a readable tip in the Help message, or in the new em_validation_sq or em_validation_q advanced question options.
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73484

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
TMSWhite wrote:
in the new em_validation_sq or em_validation_q advanced question options.
Do we have some documentation for this already?

Talking about documentation: How about the Google Analytics docs :)

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73495

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
Basic documentation for em_validation_* is here: docs.limesurvey.org/Advanced+question+se...#em_validation_q_tip

It is also linked to each question supporting it, such as here: docs.limesurvey.org/Question+type+-+Shor...sion_1.92_and_beyond

The Google Analytics documentation is here: docs.limesurvey.org/Global+settings&highlight=analytics#General

It's possible that any/all of those should be expanded, but the core documentation has been available for about a week.
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73515

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Great work!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73541

  • sammy
  • sammy's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Karma: 0
Thanks your information, I test in 1.92RC3.
Where to input the validation of question input ? Or my setting in incorrect field option of question ?
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73542

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
To add regular expression validation of short text or multiple short text, simply enter the regular expression in the "validation" field (one of the core fields, not one of the advanced question settings). This regular expression will be used to validate the short text input (or each of the multiple short text inputs, if that is the question type you use).
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73564

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
So the same regex will be applied to all sub-questions? Wouldn't that cause problems if you want to validate an adress field, an email field and a phone number in one question?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73577

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
the preg field is question specific, so in the future, we could allow for sub-question-level validation - e.g. a different regex for each sub-question. Right now, that isn't supported. However, it would really only require a new GUI to enter sub-question-level validation (and relevance, since that is also often desired), plus minor changes to EM.
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73581

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
TMSWhite wrote:
the preg field is question specific, so in the future, we could allow for sub-question-level validation - e.g. a different regex for each sub-question. Right now, that isn't supported. However, it would really only require a new GUI to enter sub-question-level validation (and relevance, since that is also often desired), plus minor changes to EM.
We should really put that on our list (If I remember correctly, you already have such a list?).
Because mostly, users use the multiple short text to ask for address or contact data and it really makes sense to have a validation for each field.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73607

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
Mazi-

If we were to augment what we can do with sub-questions, I'd propose adding the following options to each sub-question. Using your example of collecting address information as multiple short text:
(1) relevance - since different sub-fields are relevant for different countries
(2) validation - since different field-types have different validation requirements
(a) we might even want conditional validation - if you wanted to have one field for postal code, but validate it differently depending upon the addresses' country.
(3) mandatory - a different set of fields is required for each type of address
(a) we might also want to consider conditional mandatory

Of course, for now, we could simply have different multiple-short-text questions to collect addresses for each country, and use relevance to pick the proper one. However, since many of the JavaScript customizations effectively try to support some of the other features described above, we may want to try to build them in.

/Tom
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73614

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
This is a good suggestion. I don't know how much effort it takes to implement some of those features based on conditions (2a and 3a of your list) and how we should deal with a possible GUI.
Depending on that effort we should maybe start small and then extend that feature for Limesurvey 2.x?
My list of priorities would read:

1. Relevance/conditions for sub-questions
2. Mandatory setting for sub-questions
3. Validations for sub-questions
4. Conditional mandatory for sub-questions
5. Conditional validation for sub-questions

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73620

  • Steve01
  • Steve01's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 493
  • Thank you received: 47
  • Karma: 17
Hello,

perhaps we can use a "Show advanced subquestion settings" link like it is used in the "Show advanced settings" in the questions.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.

How to add regular express validation in short text input field? 4 years 10 months ago #73640

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
From a GUI point of view that is a good suggestion because only some users will use it.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.295 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form