Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: date picker dropdown - yyyy mmm only (hide dd)?

date picker dropdown - yyyy mmm only (hide dd)? 2 Jahre 6 Monate her #80419

  • tobyrhodes
  • tobyrhodess Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 20
  • Dank erhalten: 1
  • Karma: 0
Hi all

is it possible to hide the Day dropdown box of the date picker (I only want to capture Month and Year)?

I can do this by modifying the CSS by setting

.date p.question select.day {display: none;}

However, this approach then affects all date picker instances in the current survey.

Any suggestions for a work around?

Cheers
Toby
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: date picker dropdown - yyyy mmm only (hide dd)? 2 Jahre 6 Monate her #80426

  • tpartner
  • tpartners Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 4360
  • Dank erhalten: 826
  • Karma: 381
You can use a variation of this workaround - www.limesurvey.org/en/forum/can-i-do-thi...ingle-question#66820

1) Set up your survey to use JavaScript.

2) Add the following script to the source of the date question. Replace "QQ" with the date question ID.

The script hides the day dropdown of a date question and auto-populates it with the 1st day of the month.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		hideDay(QQ)
 
		function hideDay(qID) {
 
			$('#question'+qID+' .day').hide();
 
			$('#question'+qID+' .day option:eq(1)').attr('selected', 'selected');
		}
	});
 
</script>
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.
Letzte Änderung: 2 Jahre 6 Monate her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: date picker dropdown - yyyy mmm only (hide dd)? 2 Jahre 6 Monate her #80451

  • tobyrhodes
  • tobyrhodess Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 20
  • Dank erhalten: 1
  • Karma: 0
Brilliant tpartner - that works a treat - just what I needed.
Many thanks
Toby
:)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: date picker dropdown - yyyy mmm only (hide dd)? 2 Jahre 6 Monate her #80452

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5423
  • Dank erhalten: 307
  • Karma: 252
tobyrhodes schrieb:
Brilliant tpartner - that works a treat - just what I needed.
Many thanks
Toby
:)
You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to give Limesurvey a future .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.134 Sekunden
Donation Image