- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
have Limesurvey go to the next question group when first answer is given
- cvandermeij
- Topic Author
- Offline
- New Member
Less
More
11 years 5 months ago - 11 years 5 months ago #88477
by cvandermeij
have Limesurvey go to the next question group when first answer is given was created by cvandermeij
Would it be possible to configure a script that directs the respondent directly to the next page of the survey (question group) once an answer on the previous page has been given? I am working on a survey which has just one question per page. Once a question has been answered, I would like to direct the respondent immediately to the next page of the survey.
Could this be achieved by using Javascript? I have something like this in a text-display element. I am talking about survey ID 948181, question group ID 16 and question ID 96, whereas the text-display element has question ID 108.
Could this be achieved by using Javascript? I have something like this in a text-display element. I am talking about survey ID 948181, question group ID 16 and question ID 96, whereas the text-display element has question ID 108.
Code:
<input type="hidden" name="948181X16X108" id ="948181X16X108" value="" /> <script type="text/javascript"> <!-- //Change the elements of the arrray to the varnames of your question var answerItems = new Array('948181X16X96'); //Change this to the the varname of the text-display variable var idOfInputField = '948181X16X108'; function submitform() { document.f1.submit(); } --> </script>
Last edit: 11 years 5 months ago by cvandermeij.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
11 years 5 months ago #88488
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic have Limesurvey go to the next question group when first answer is given
Hello,
For radio single choice question list:
For radio single choice question list:
Code:
<script> $(function() { $("#question{QID} input.radio").click(function(){ $("#movenextbtn").click(); }); }); </script>
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- cvandermeij
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 5 months ago - 11 years 5 months ago #88489
by cvandermeij
Replied by cvandermeij on topic have Limesurvey go to the next question group when first answer is given
Thanks Dennis, this works great! Do you also know where I should put the code to hide the next/submit button for pages where I use the 'click is next page'.
It should contain something like this I suppose
$('#movesubmitbtn, #movenextbtn').attr('disabled', 'disabled');
It should contain something like this I suppose
$('#movesubmitbtn, #movenextbtn').attr('disabled', 'disabled');
Last edit: 11 years 5 months ago by cvandermeij.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
11 years 5 months ago - 11 years 5 months ago #88490
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic have Limesurvey go to the next question group when first answer is given
Put in in a specific class (see navigator.pstpl) and hide it in css.
(and NO attr disabled)
Denis
PS: api.jquery.com/hide/
(and NO attr disabled)
Denis
PS: api.jquery.com/hide/
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 11 years 5 months ago by DenisChenu. Reason: http://api.jquery.com/hide/
The topic has been locked.
- cvandermeij
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 5 months ago #88491
by cvandermeij
Replied by cvandermeij on topic have Limesurvey go to the next question group when first answer is given
Hi Dennis, thanks again. But I would like to enable the next/submit button for some pages (with just informational text) and disable it for radio button questions. How would I make a distinction between enable/disable?
Thanks.
Thanks.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
11 years 5 months ago #88492
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic have Limesurvey go to the next question group when first answer is given
.hide
it in javascript. If button is deactivated , the .click do nothing.
(you can addClass too).
Denis
(you can addClass too).
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- cvandermeij
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
11 years 5 months ago #88495
by cvandermeij
Replied by cvandermeij on topic have Limesurvey go to the next question group when first answer is given
Hi Denis, great. It is working. Thanks.
The topic has been locked.
- MERR1Lab
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
4 years 6 months ago - 4 years 6 months ago #189841
by MERR1Lab
Replied by MERR1Lab on topic have Limesurvey go to the next question group when first answer is given
Hi,
If I want to move two pages forward, what changes do I have to make in the script provided above?
Thanks!
If I want to move two pages forward, what changes do I have to make in the script provided above?
Thanks!
Last edit: 4 years 6 months ago by MERR1Lab.
The topic has been locked.