Welcome, Guest
Username: Password: Remember me

TOPIC: default value for date question

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

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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

default value for date question 5 months 1 week ago #110101

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4372
  • Thank you received: 830
  • Karma: 381
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 5 months 1 week ago #110110

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1155
  • Thank you received: 274
  • Karma: 79
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

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
The administrator has disabled public write access.

default value for date question 5 months 1 week ago #110120

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4372
  • Thank you received: 830
  • Karma: 381
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 5 months 1 week 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.181 seconds
Donation Image