default value for date question

More
4 years 2 days ago #110063 by jdcsyoung
jdcsyoung created the topic: default value for date question
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.

Please Log in or Create an account to join the conversation.

More
4 years 2 days ago #110073 by Ben_V
Ben_V replied the 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)

Please Log in or Create an account to join the conversation.

More
4 years 1 day ago #110101 by tpartner
tpartner replied the 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.

{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

Please Log in or Create an account to join the conversation.

More
4 years 1 day ago #110110 by Ben_V
Ben_V replied the 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)

Please Log in or Create an account to join the conversation.

More
4 years 1 day ago #110120 by tpartner
tpartner replied the 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

Please Log in or Create an account to join the conversation.

More
4 years 1 day ago #110130 by jdcsyoung
jdcsyoung replied the topic: default value for date question
Exactly what I was hoping for! thanks

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!