Welcome to the LimeSurvey Community Forum

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

Show "Submit" Button AFTER "Yes" (Radio or Yes/no) v3.15.9

  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 month ago - 5 years 1 month ago #181065 by UdoHolzmann
Hi. I have seen this issue discussed with earlier versions of LS. I am using 3.15.9.

At the very end of my survey (last question of last group), I want the user to confirm that they are ready to submit their Information after clicking "Yes" using a radio button or Yes/No box option.

Any ideas on the JavaScript needed for this?

Thanks.
Last edit: 5 years 1 month ago by UdoHolzmann.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #181067 by Joffm
Hi,

what do you want to happen if the user clicks "No"?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 month ago #181068 by UdoHolzmann
The "Submit" button should remain hidden. Thanks.
The topic has been locked.
  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 month ago #181129 by UdoHolzmann
Anyone? Please...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #181149 by tpartner
If using a Yes/No type question, you can add a script like this to the question source:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
 
    // Hide the submit button
    $('#ls-button-submit').hide();
 
    // Listener on the yes/no answers
    $('#question{QID} input:radio').on('change', function(e) {
      if($('#question{QID} input:radio:checked:eq(0)').val() == 'Y') {
        $('#ls-button-submit').fadeIn(500);
      }
      else {
        $('#ls-button-submit').fadeOut(500);
      }
    });
  });  
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...2-28.lss
File Size:28 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: NoraSalasIllanes
The topic has been locked.
  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 month ago #181151 by UdoHolzmann
Thanks. I will give this a try. Dumb question: where is the question source? You mean click "source" in the text box where I write my question and paste there?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #181153 by tpartner
See this article about how to add JavaScript - manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 1 month ago #181154 by UdoHolzmann
Thanks. That helps a lot.

In your code above, do I have to edit "#question{QID}" to "#question1234"?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 month ago #181158 by tpartner
Nope, the {QID} placeholder will automatically return the question ID.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • UdoHolzmann
  • UdoHolzmann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 weeks ago #181164 by UdoHolzmann
Awesome. It does work. Thank you much!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #182505 by tpartner
That does not target a specific question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose