Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Restricted date range 2.00

Restricted date range 2.00 3 years 1 week ago #102052

Hi Guys,

We are using LimeSurvey 2.00+ Build: 131122 and we want a restricted on the dates for some questions. We have found code which works for 1.90 but it doesn't seem to work (for us anyway) in 2.00.

1) What script do we need to ensure that a date picker is limited to before a certain date (November 24th for us)
2) What script do we need to ensure that a date picker is limited to before a certain date (November 24th for us) but after a certain date for another question?

Our current code is (for 1, taken from LimeSurvey wiki):

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

var qID = "186597X383X5246";

$('#question'+qID+' .popupdate').datepicker( 'option', 'maxDate', new Date(2013, 11-1, 24) );

});

</script>

Which does not work and doesn't throw anything in my javascript console.

I realize that this is extremely straightforward in 2.05, however we would rather used a released development.

Thank you so much!

Mark
The administrator has disabled public write access.

Restricted date range 2.00 3 years 1 week ago #102059

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1897
  • Thank you received: 469
  • Karma: 118
Hello,

Your code shows a confusion about "qid" (=question ID) and "SGQ" (survey, group, question IDs);
"qid" is only the last component of the SGQ code.

var qID = "186597X383X5246"

should be:

var qID = "5246";

Hope this solves your problem
BenoƮt

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 3 years 1 week ago by Ben_V.
The administrator has disabled public write access.

Restricted date range 2.00 3 years 1 week ago #102084

Yup it did, you are amazing Ben.
The administrator has disabled public write access.
Time to create page: 0.224 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form