Welcome to the LimeSurvey Community Forum

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

Hide datepicker

  • isartbar
  • isartbar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 months ago #104762 by isartbar
Hide datepicker was created by isartbar
I have been searching in the forum but can't quite find it. I'm asking a birth date and use the date type of question. I want to hide the datepicker because it isn't really usefull for this type of question. I tried in javascript in the template.js in the
Code:
$(document).ready(function()
:
Code:
$('#answer{SGQ}1').datepicker("destroy");

but this doesn't work.

Any suggestions on hiding the datepicker or on a different way of getting a valid date are welcome.

Thx,

Isart
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 2 months ago #104763 by holch
Replied by holch on topic Hide datepicker
Well, I think the date type of question is made especially to have the date picker.

I think it is probably easier to use a text question and use validation via regex to get the right date format or you could use some kind of Javascript mask to guarantee that the format of the date is right. I think Tpartner has posted some kind of javascript plugin for masking text questions.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
10 years 2 months ago #104768 by Ben_V
Replied by Ben_V on topic Hide datepicker
FYI, in the advanced settings of your question you can select dropdown boxes instead js datepicker... and set the start and maximum for years choice... But maybe you prefer use a basic text question with validation!

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.
  • isartbar
  • isartbar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 2 months ago #104770 by isartbar
Replied by isartbar on topic Hide datepicker
Thx for the fast response. I had been thinking about adding a plugin for text field masking, but then I have to turn of filterxsshtml, which I rather not do. I completely overlooked the dropdown boxes option in advanced settings. This is for me the simplest and most elegant solution. Thx Ben_V and holch.

Isart.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose