- Posts: 11
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
add 'are you sure' to 'no answer' as default in radio list
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
10 years 2 weeks ago #107416
by pietpomp
add 'are you sure' to 'no answer' as default in radio list was created by pietpomp
Hi Guys, I have a Q-group of a few questions that are not mandatory and so displays 'no-answer' as the default answer in a radio list (survey is set to display by group v2.05+).
This allows user to skip the page 'by accident' without reading the questions.
I would like to add a check on the page (group) that (for example pops up) would check to see if any q's are still on 'no answer' and then ask the user "Are you sure you don't want to answer?". Yes -> survey goes on with next group(like Next button), No -> survey stays on page.
Had a look at conditions, but not sure how to get it to stay on the same group after the check...
Thanks
-apologies, my previous duplicate #107414 was in the wrong forum section.
This allows user to skip the page 'by accident' without reading the questions.
I would like to add a check on the page (group) that (for example pops up) would check to see if any q's are still on 'no answer' and then ask the user "Are you sure you don't want to answer?". Yes -> survey goes on with next group(like Next button), No -> survey stays on page.
Had a look at conditions, but not sure how to get it to stay on the same group after the check...
Thanks
-apologies, my previous duplicate #107414 was in the wrong forum section.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13647
- Thank you received: 2491
10 years 2 weeks ago #107420
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 add 'are you sure' to 'no answer' as default in radio list
With EM and without change:1st question code MULTIQ
Solution 1
Add a second question, CONFIRM : multiple with only one answer 'Are you sure you don't want to answer' and set it mandatory.
Second question condition sum(is_empty(that.QQ))>0
Solution 2
Add 'No answer' answer and set MULTIQ mandatory. User have to click on 'No Answer' answre.
Solution 3
jquery/javascripting : Add an event on submit $("#limesurvey").submit(.... and call a confirm box here.
Denis
Solution 1
Add a second question, CONFIRM : multiple with only one answer 'Are you sure you don't want to answer' and set it mandatory.
Second question condition sum(is_empty(that.QQ))>0
Solution 2
Add 'No answer' answer and set MULTIQ mandatory. User have to click on 'No Answer' answre.
Solution 3
jquery/javascripting : Add an event on submit $("#limesurvey").submit(.... and call a confirm box here.
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 following user(s) said Thank You: pietpomp
The topic has been locked.
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
10 years 2 weeks ago #107424
by pietpomp
Replied by pietpomp on topic add 'are you sure' to 'no answer' as default in radio list
thx Denis,
I've got a group by group presentation and I want the confirmation to pop up on one group (page1) with say 4 questions before they get to the next group (page2).
So I don't understand how Solution 1 will be added or how it could work, cause manual said condition only work for the next page of questions.
Solution 2 sounds good, but will make them 1. have to enter and value and 2. keep popping up for each q in the group instead of once for the page.
Solution 3 looks the most promising. That way I could maybe also have a custom message. Unfortunately I'm useless with js. But it looks like you are suggesting to intercept the next button with the check. That would be perfect as long as the user continues after one pop up per page and not a pop up for each question on the page. So I guess the js would need to check if there are any 'no answer' values present on the page and then do the pop up.
Would you be able to help with the js please?
cheers
I've got a group by group presentation and I want the confirmation to pop up on one group (page1) with say 4 questions before they get to the next group (page2).
So I don't understand how Solution 1 will be added or how it could work, cause manual said condition only work for the next page of questions.
Solution 2 sounds good, but will make them 1. have to enter and value and 2. keep popping up for each q in the group instead of once for the page.
Solution 3 looks the most promising. That way I could maybe also have a custom message. Unfortunately I'm useless with js. But it looks like you are suggesting to intercept the next button with the check. That would be perfect as long as the user continues after one pop up per page and not a pop up for each question on the page. So I guess the js would need to check if there are any 'no answer' values present on the page and then do the pop up.
Would you be able to help with the js please?
cheers
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 2 weeks ago - 10 years 2 weeks ago #107429
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic add 'are you sure' to 'no answer' as default in radio list
Denis' solution 3...
Set up your survey to use JavaScript
If you want to pop up the confirm message every time the "Next" button is clicked and some "No Answer" radios are checked, add this to the question source of any question on the page:
If you only want it to happen the first time the "Next" button is clicked, add this to the question source of any question on the page:
.
Set up your survey to use JavaScript
If you want to pop up the confirm message every time the "Next" button is clicked and some "No Answer" radios are checked, add this to the question source of any question on the page:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Interrupt the submit process $('#movenextbtn, #movesubmitbtn').bind('click', function () { if($('input.radio[value=""]:checked').length > 0) { var moveOn = confirm("Some questions remain unanswered. \nDo you want to continue?"); if (moveOn == false) { return false; } } }); }); </script>
If you only want it to happen the first time the "Next" button is clicked, add this to the question source of any question on the page:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var confirmShown = 0; // Interrupt the submit process $('#movenextbtn, #movesubmitbtn').bind('click', function () { if($('input.radio[value=""]:checked').length > 0 && confirmShown == 0) { confirmShown = 1; var moveOn = confirm("Some questions remain unanswered. \nDo you want to continue?"); if (moveOn == false) { return false; } } }); }); </script>
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 10 years 2 weeks ago by tpartner.
The following user(s) said Thank You: pietpomp
The topic has been locked.
- pietpomp
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
10 years 2 weeks ago #107454
by pietpomp
Replied by pietpomp on topic add 'are you sure' to 'no answer' as default in radio list
Legend!
Thank you guys and tpartner thanks so much for the two versions. It's clear you can see what the next question could have been and giving a working script for that to.
I was going to ask about the custom button text, but google covered that one hehe.
Can smell the end now, just need to get this glitch sorted.
Cheers
Thank you guys and tpartner thanks so much for the two versions. It's clear you can see what the next question could have been and giving a working script for that to.
I was going to ask about the custom button text, but google covered that one hehe.
Can smell the end now, just need to get this glitch sorted.
Cheers
The topic has been locked.