Welcome to the LimeSurvey Community Forum

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

Restricted date range 2.00

  • StuartMark0
  • StuartMark0's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #102052 by StuartMark0
Restricted date range 2.00 was created by StuartMark0
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 topic has been locked.
More
10 years 3 months ago - 10 years 3 months ago #102059 by Ben_V
Replied by Ben_V on topic Restricted date range 2.00
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
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 10 years 3 months ago by Ben_V.
The topic has been locked.
  • StuartMark0
  • StuartMark0's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 months ago #102084 by StuartMark0
Replied by StuartMark0 on topic Restricted date range 2.00
Yup it did, you are amazing Ben.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose