Welcome to the LimeSurvey Community Forum

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

default value for date question

  • jdcsyoung
  • jdcsyoung's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 5 months ago #110063 by jdcsyoung
default value for date question was created by jdcsyoung
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 topic has been locked.
More
10 years 5 months ago #110073 by Ben_V
Replied by Ben_V on topic default value for date question
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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 5 months ago #110101 by tpartner
Replied by tpartner on topic default value for date question
If you want today's date as the default for a normal date question (not dropdowns), use this as the default answer.

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


.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jdcsyoung
The topic has been locked.
More
10 years 5 months ago #110110 by Ben_V
Replied by Ben_V on topic default value for date question
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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 5 months ago #110120 by tpartner
Replied by tpartner on topic default value for date question
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 following user(s) said Thank You: Ben_V
The topic has been locked.
  • jdcsyoung
  • jdcsyoung's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 5 months ago #110130 by jdcsyoung
Replied by jdcsyoung on topic default value for date question
Exactly what I was hoping for! thanks
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose