Restricted date range 2.00

More
3 years 11 months ago #102052 by StuartMark0
StuartMark0 created the topic: Restricted date range 2.00
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

Please Log in to join the conversation.

More
3 years 11 months ago - 3 years 11 months ago #102059 by Ben_V
Ben_V replied the 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: 3 years 11 months ago by Ben_V.

Please Log in to join the conversation.

More
3 years 11 months ago #102084 by StuartMark0
StuartMark0 replied the topic: Restricted date range 2.00
Yup it did, you are amazing Ben.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!