Welcome to the LimeSurvey Community Forum

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

[version 3.21.2] Reach subquestion value for IF condition in question

  • cesoielampo
  • cesoielampo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #203040 by cesoielampo
Hello,
Since i found no way to hide radio button answers with a condition i thought i could do it via javascript.

So i ended up here:
Code:
{A10_SQ001} 
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
if ({A10_SQ001}=="Y") {$('#javatbd432345X72X3234C31').hide();}
    });
</script>
 

The first line correctly returns "Y"

In the source code i see
Code:
if (Y=="Y") <span class='em-expression em-haveerror'  ><span class='em-error' title=' ' ><span title="Sintassi non supportata"> $ </span>

"Unsupported Syntax"

What am i doing wrong?

Thanks,

Regards,
The topic has been locked.
  • cesoielampo
  • cesoielampo's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 9 months ago #203041 by cesoielampo
Sorry i found out,
Code:
{A10_SQ001} 
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
if ("{A10_SQ001}" == "Y") { 
$('#javatbd432345X72X3234C31').hide();
}
    });
</script>
 

i had to add the double quotes to the identifier and give some space around curly braces.

Sorry,

Regards,
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose