Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Hide datepicker

Hide datepicker 5 Monate 3 Wochen her #104762

  • isartbar
  • isartbars Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 2
  • Karma: 0
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
$(document).ready(function()
:
$('#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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hide datepicker 5 Monate 3 Wochen her #104763

  • holch
  • holchs Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 2560
  • Dank erhalten: 290
  • Karma: 105
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hide datepicker 5 Monate 3 Wochen her #104768

  • Ben_V
  • Ben_Vs Avatar
  • OFFLINE
  • Platinum Lime
  • Beiträge: 1061
  • Dank erhalten: 234
  • Karma: 74
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

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...
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Hide datepicker 5 Monate 3 Wochen her #104770

  • isartbar
  • isartbars Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 2
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.235 Sekunden
Donation Image