Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Restrict Future Dates using Date question type.

Restrict Future Dates using Date question type. 1 Jahr 4 Wochen her #97612

  • LSCitizen
  • LSCitizens Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 33
  • Karma: 0
Hello-
I would like to restrict users from entering future dates by using the Date question type.
When I enter the current year as the Maximum Year, users are able to view and select a future date. Is there a way to restrict this using JavaScript or jQuery? I would like for users to be able to select the current date and any past date.

Thanks

I currently using: Version 1.92+ Build 120620
Letzte Änderung: 1 Jahr 4 Wochen her von LSCitizen. Begründung: Needed to add more information.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Restrict Future Dates using Date question type. 1 Jahr 4 Wochen her #97661

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4072
  • Dank erhalten: 748
  • Karma: 341
Add this to the question source:
<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
		$('#question{QID} .popupdate').datepicker( 'option', 'maxDate', new Date() );
	});
</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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: LSCitizen
Moderatoren: ITEd
Ladezeit der Seite: 0.137 Sekunden
Donation Image