Welcome, Guest
Username: Password: Remember me

TOPIC: Expression Manager: Use Expressions in Validation field

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #72938

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
1.92 RC3 will be released tonight. It provides the validation messages you expect.
The administrator has disabled public write access.

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #72941

  • Fred
  • Fred's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 163
  • Thank you received: 5
  • Karma: 3
Great thanks
The administrator has disabled public write access.

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #72950

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
1.92 RC3 has been released. The announcement is currently here, and should show up on the main page relatively soon.
The administrator has disabled public write access.

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73000

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5302
  • Thank you received: 291
  • Karma: 247
Good question. This might have changed because the Expression Manager now handles the validation in real time, meaning fields are marked green if all is fine and red if any validation fails. Maybe the additional "Total of all entries must not exceed 100" information is now oly shown if validation fails? Can you test, Fred?

Tom, did this behavior change?

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

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73032

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Mazi-

If you set the advanced question option to hide the tip, then the validation message only appears if you don't meet the criteria. If you don't hide the tip, then the validation message will be visible all the time.

/Tom
The administrator has disabled public write access.

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73034

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5302
  • Thank you received: 291
  • Karma: 247
That makes sense!

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

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73053

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
Hello,

I updated my "My little Test-Survey". The "Hide tip" option seems to work as mentioned. But I have the example donate question in the survey and it seems that the validation of the regex and/or EM expression seems to happen every time you answer a question even it you don't really enter anything in the donate question. So it is marked red but you even haven't answerd the question at all.

Have a look at the survey at
212.65.8.158/limesurveyEM/index.php?sid=61131&lang=en
If you for example enter a name the validation for the donate question will trigger and mark it red.
Mit freundlichen Grüßen/Best regards,

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

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73057

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5302
  • Thank you received: 291
  • Karma: 247
Talking about marking invalid answers: Can we have a light red background for text fields. Text in those fields is a little hard to read because of the strong red color.

Opinions?

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

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73071

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Mazi wrote:
Talking about marking invalid answers: Can we have a light red background for text fields. Text in those fields is a little hard to read because of the strong red color.

Good idea. Can you recommend a specific CSS color?

Incidentally, I originally tried to do this by adding a style class, but I didn't see a reliable way to remove that class when the validation criteria pass (since there might be other classes attached to the question and I didn't want to mess them up).
The administrator has disabled public write access.

Re: Expression Manager: Use Expressions in Validation field 2 years 6 months ago #73073

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
vierundzwanzig wrote:
I updated my "My little Test-Survey". The "Hide tip" option seems to work as mentioned. But I have the example donate question in the survey and it seems that the validation of the regex and/or EM expression seems to happen every time you answer a question even it you don't really enter anything in the donate question. So it is marked red but you even haven't answerd the question at all.

That's actually the intended behavior.
By default, if you have a regular expression validation, you can still leave the question blank. However, you added this em_validation_q criteria:
if(is_numeric(this), this > 50, substr(this, 1) > 50)

That criteria will fail if the question is blank, so EM is accurately flagging the question in red so that you know you have to answer it. To allow blank entries, you can adjust the em_validation_q to this:
if (is_empty(this),1,if(is_numeric(this), this > 50, substr(this, 1) > 50))

You may be asking a related question - is there a way to avoid flagging questions as red until the person navigates past that question. Eventually there may be a way to do that by using the qseq (question sequence) attribute, but I expect people may want that built in rather than needing to tailor the
em_validation_q equation. If that is a desirable feature, please add it to ideas.limesurvey.org so we can get some votes for/against it.

/Tom
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.255 seconds
Donation Image