Another disable "next" button question

More
3 years 8 months ago #116175 by fanepic
fanepic replied the topic: Another disable "next" button question
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?

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago #116179 by tpartner
tpartner replied the topic: Another disable "next" button question
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.

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago - 3 years 8 months ago #116186 by fanepic
fanepic replied the topic: Another disable "next" button question
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: 3 years 8 months ago by fanepic. Reason: mistake

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago #116187 by tpartner
tpartner replied the topic: Another disable "next" button question
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.

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago - 3 years 6 months ago #118213 by samarta
samarta replied the topic: Another disable "next" button question
Cheers,

I am trying to disable the next button based on a comparison of the values of 2 questions but it simply does not work. (I don't know the correct syntax)

the script is:

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {

$('#movenextbtn').hide();
if(($('#answer858668X1964X50571')- $('#answer858668X1964X50572')) >5')){
$('#movenextbtn').show();
}

});
</script>

The error is in the comparison. I tried if(7>5) and it worked.
Thanks in advance

João
Last Edit: 3 years 6 months ago by samarta. Reason: incomplete

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118216 by holch
holch replied the topic: Another disable "next" button question
But 7 is bigger than 5, thus it should show the button. So I guess this is correct behaviour...

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118227 by samarta
samarta replied the topic: Another disable "next" button question
Hi,

what i meant is: I've changed the script to
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {

$('#movenextbtn').hide();
if(7>5)
{
$('#movenextbtn').show();
}

});
</script>

And it worked.


My question is if the sintax of the following line is correct:
if(($('#answer858668X1964X50571')- $('#answer858668X1964X50572')) >5'))
{
$('#movenextbtn').show();
}

Because is not working as I expect.



Thanks,

João

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago - 3 years 6 months ago #118232 by tpartner
tpartner replied the topic: Another disable "next" button question
Try this (assuming the questions are text type):

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
 
		$('#movenextbtn').hide();
 
		if(($('#answer858668X1964X50571').val() - $('#answer858668X1964X50572').val()) >5')) {
			$('#movenextbtn').show();
		}
	});
</script>

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 6 months ago by tpartner.

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118233 by samarta
samarta replied the topic: Another disable "next" button question
Hi ,
anf if the questions are numerical type?

still using .val() ?

Thanks

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118234 by tpartner
tpartner replied the topic: Another disable "next" button question
Yes, numerics also use text type inputs.

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: samarta

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118237 by samarta
samarta replied the topic: Another disable "next" button question
Thank you very much.

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118242 by samarta
samarta replied the topic: Another disable "next" button question
Hi,

Can get this stuff work.

I made code simplier and still does not work
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {

$('#movenextbtn').hide();
if($('#answer858668X1963X50568').val()>5){
$('#movenextbtn').show();
}
});
</script>

I introuced this code on the source of a question of group (1964) to see if the problem was in putting the source of the same group.

I can't get this working.

I appreciate any help.

I've tried also to if($('#answer858668X1963X50568').val()>5') but the last ' does not closes any previous '


Thanks

João

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118243 by Ben_V
Ben_V replied the topic: Another disable "next" button question
I don't know the software version you are using, but you can maybe try a mix JS/EM

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)

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118244 by tpartner
tpartner replied the topic: Another disable "next" button question
Do you have the correct identifier for the input ('#answer858668X1963X50568')?

Can you activate a test survey?


.

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

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #118245 by Ben_V
Ben_V replied the topic: Another disable "next" button question

tpartner wrote: Do you have the correct identifier for the input ('#answer858668X1963X50568')?

Sometimes I feel a kind of {nostalgia}...

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)

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!