Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Another disable "next" button question

Another disable "next" button question 1 month 2 weeks ago #116159

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4569
  • Thank you received: 896
  • Karma: 401
In that case, adding this to the source of one of the questions on every page (group) you want affected should work.

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		$('#movenextbtn, #movesubmitbtn').hide();
 
		$('input.radio').bind('click', function(e) {
			if($('input.radio:checked').length == $('.radio-list').length) {
				$('#movenextbtn, #movesubmitbtn').show();
			}
		});
 
    });
</script>


Or, if you want to affect every page (group) in the survey, add this to the end of template.js:

$(document).ready(function() {
 
	$('#movenextbtn, #movesubmitbtn').hide();
 
	$('input.radio').bind('click', function(e) {
		if($('input.radio:checked').length == $('.radio-list').length) {
			$('#movenextbtn, #movesubmitbtn').show();
		}
	});
 
});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: fanepic

Another disable "next" button question 1 month 2 weeks ago #116164

  • fanepic
  • fanepic's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Thank you so much this scripts are working:)
The only thing is if you go back the next button is hidding until you change a radio button or press it again. Can i fix that somehow?
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116166

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4569
  • Thank you received: 896
  • Karma: 401
Try this:

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		$('#movenextbtn, #movesubmitbtn').hide();
		if($('input.radio:checked').length == $('.radio-list').length) {
			$('#movenextbtn, #movesubmitbtn').show();
		}
 
		$('input.radio').bind('click', function(e) {
			if($('input.radio:checked').length == $('.radio-list').length) {
				$('#movenextbtn, #movesubmitbtn').show();
			}
		});
 
    });
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: fanepic

Another disable "next" button question 1 month 2 weeks ago #116168

  • fanepic
  • fanepic's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Awesome this works:) thanks for that
The only thing that doesn't work is that if a question is hidden by a condition it needs to be pressed as well for showing the next button. Is there a way to apply it just on the visible buttons?
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116171

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4569
  • Thank you received: 896
  • Karma: 401
As I said, this has the potential to get quite complicated. Have a look at the jQuery :visible selector - api.jquery.com/visible-selector/.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116175

  • fanepic
  • fanepic's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Yeah I see your point, is there a way to check if the hidden field is yes.
So I can make all the condition for the hidden fields and show the next button based on its value?
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116179

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4569
  • Thank you received: 896
  • Karma: 401
Sorry, I don't understand the question.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116186

  • fanepic
  • fanepic's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
sorry for that, i'm trying something like this:
<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
          // Initially disable the Next/Submit button
               $('#movenextbtn').hide ();
		$('hidden.radio[value="Y"]').click(function(){
                     $('#movenextbtn').show
 
});
});</script>
 

If a hidden radio is Y show the next Button.
Last Edit: 1 month 2 weeks ago by fanepic. Reason: mistake
The administrator has disabled public write access.

Another disable "next" button question 1 month 2 weeks ago #116187

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4569
  • Thank you received: 896
  • Karma: 401
I still don't get where you're going with this but there is no jQuery "hidden" element, you would need to target the radio specifically with an ID and you have some syntax errors.

Something like this (of course, replacing "answer11111X22X33A1" with the correct ID):

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
 
		$('#movenextbtn, #movesubmitbtn').hide();
 
		if($('#answer11111X22X33A1').is(':checked')) {
			$('#movenextbtn, #movesubmitbtn').show();
		}
 
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.163 seconds
Donation Image