Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Display a message if a selected date is less than X days away.

  • cyril.pereira
  • cyril.pereira's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 days 5 hours ago #269312 by cyril.pereira
LimeSurvey Community Edition Version 6.5.18+240723

Hello,

Three years ago, I created a questionnaire for a service at the university where I work. I was quite proficient at the time, but I have forgotten a lot since then, and this service is now asking me to add a feature to the form...

In this questionnaire, there is a point where a date needs to be selected. If the chosen date is less than X days from today's date, a message should be displayed.

Unfortunately, I don't have the knowledge to set up this condition—I believe some coding is required. I tried looking for a pre-existing condition but couldn't find one.

It would be amazing to get a little help! :-)

Thank you in advance,
Cyril
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 days 4 hours ago #269315 by Joffm
Hi,
we do not like cross posts.
You asked this question one day ago in the French section.
At least you should have mentioned this.

It is really frustrating for us volunteers if somebody gives an answer in one section - only to see that there was an answer - probably the same - already in another section.
Please keep this in mind in the future.

But to answer your question:

1. setting "Minimum date"
See the manual.
[url] www.limesurvey.org/manual/Question_type_...imum_date_(date_min) [/url]
a.. "+10 days"
b. date("Y-m-d",strtotime('now')+10*60*60*24)

2. question validation equation
The selected date must not be smaller than the actual date + 10 days
strtotime(self)-strtotime('now')>10*60*60*24

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • cyril.pereira
  • cyril.pereira's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 days 4 hours ago - 4 days 4 hours ago #269317 by cyril.pereira
Hi Joffm, I am sincerely sorry. My approach was in good faith; I was in a bit of a rush and worried, and I genuinely thought there was less activity on the French forum. It was not my intention to post my request everywhere; otherwise, I would have done so on the forums in other languages as well. But uou're absolutely right, I should have mentionned my other messge.
My sincere apologies, and thank you very much for your help.

I have also informed others about your solution in my message on the French forum.
Last edit: 4 days 4 hours ago by cyril.pereira. Reason: Information complémentaire

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose