Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: default value for date question

default value for date question 2 years 2 months ago #110063

  • jdcsyoung
  • jdcsyoung's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
I am a newbie - this should be an easy question!

I want to default a date questions answer to the current date. What do I put in the default value area to make this happen? Every variation I can think of involving "now" or "today" or "date" doesn't seem to work.
The administrator has disabled public write access.

default value for date question 2 years 2 months ago #110073

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
Hi,
if your "default value" is the current date, it's here :) (if not, try to adapt the script).
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

default value for date question 2 years 2 months ago #110101

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6214
  • Thank you received: 1376
  • Karma: 539
If you want today's date as the default for a normal date question (not dropdowns), use this as the default answer.

{date('Y-m-d')}


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: jdcsyoung

default value for date question 2 years 2 months ago #110110

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
It seems that the date picker uses already the current date as default answer...so NO additional code is needed !
Excuse me for being sometimes 100% ready to promote the reinvention of the wheel !
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

default value for date question 2 years 2 months ago #110120

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6214
  • Thank you received: 1376
  • Karma: 539
Yeah, but the input isn't populated, so maybe we do need the new wheel :laugh:


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V

default value for date question 2 years 2 months ago #110130

  • jdcsyoung
  • jdcsyoung's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Exactly what I was hoping for! thanks
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.326 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form