Welcome to the LimeSurvey Community Forum

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

Date picker - allow only Fridays/day of week selection

  • rabshier1
  • rabshier1's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 2 weeks ago #166495 by rabshier1
I would like to create a validation on a date selection in my survey so the response (which is selection of a date) can only be a particular day of the week (Friday). I don't know the date picker well enough to know if there's a way I can validate like: DayOfWeek = "Friday"

Any ideas?

Thanks ---
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 weeks ago #166498 by tpartner
Add this script to the question source:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){  
    // Disable everything except Fridays
    $('#answer{SGQ}_datetimepicker').data('DateTimePicker').daysOfWeekDisabled([0,1,2,3,4,6]); 
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: rabshier1
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose