- Posts: 10099
- Thank you received: 3589
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Another disable "next" button question
- Taereian_43648
- Visitor
9 years 3 months ago #116175
by Taereian_43648
Replied by Taereian_43648 on 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?
So I can make all the condition for the hidden fields and show the next button based on its value?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
9 years 3 months ago #116179
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 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.
The topic has been locked.
- Taereian_43648
- Visitor
9 years 3 months ago - 9 years 3 months ago #116186
by Taereian_43648
Replied by Taereian_43648 on topic Another disable "next" button question
sorry for that, i'm trying something like this:
If a hidden radio is Y show the next Button.
Code:
<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: 9 years 3 months ago by Taereian_43648. Reason: mistake
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 3 months ago #116187
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 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):
Something like this (of course, replacing "answer11111X22X33A1" with the correct ID):
Code:
<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.
The topic has been locked.
- samarta
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 1
9 years 1 month ago - 9 years 1 month ago #118213
by samarta
Replied by samarta on 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
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: 9 years 1 month ago by samarta. Reason: incomplete
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
9 years 1 month ago #118216
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on 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 answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- samarta
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 1
9 years 1 month ago #118227
by samarta
Replied by samarta on 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
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
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 1 month ago - 9 years 1 month ago #118232
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 Another disable "next" button question
Try this (assuming the questions are text type):
Code:
<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: 9 years 1 month ago by tpartner.
The topic has been locked.
- samarta
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 1
9 years 1 month ago #118233
by samarta
Replied by samarta on topic Another disable "next" button question
Hi ,
anf if the questions are numerical type?
still using .val() ?
Thanks
anf if the questions are numerical type?
still using .val() ?
Thanks
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 1 month ago #118234
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 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
The topic has been locked.
- samarta
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 1
9 years 1 month ago #118237
by samarta
Replied by samarta on topic Another disable "next" button question
Thank you very much.
The topic has been locked.
- samarta
- Offline
- Junior Member
Less
More
- Posts: 33
- Thank you received: 1
9 years 1 month ago #118242
by samarta
Replied by samarta on 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
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
The topic has been locked.