- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
default value for date question
- jdcsyoung
- Topic Author
- Offline
- New Member
Less
More
9 years 9 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.
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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
9 years 9 months ago #110073
by Ben_V
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)
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).
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 9 months ago #110101
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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.
- Ben_V
- Offline
- Platinum Member
Less
More
- Posts: 1223
- Thank you received: 351
9 years 9 months ago #110110
by Ben_V
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)
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 !
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 9 months ago #110120
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
9 years 9 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.