Welcome, Guest
Username: Password: Remember me

TOPIC: default value for date question

default value for date question 1 year 7 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 1 year 7 months ago #110073

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1596
  • Thank you received: 391
  • Karma: 103
Hi,
if your "default value" is the current date, it's here :) (if not, try to adapt the script).
Benoît
The administrator has disabled public write access.

default value for date question 1 year 7 months ago #110101

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5419
  • Thank you received: 1156
  • Karma: 480
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: jdcsyoung

default value for date question 1 year 7 months ago #110110

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1596
  • Thank you received: 391
  • Karma: 103
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
The administrator has disabled public write access.

default value for date question 1 year 7 months ago #110120

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5419
  • Thank you received: 1156
  • Karma: 480
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V

default value for date question 1 year 7 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.221 seconds