When I add JS for hide some option in the display.
Below is the script
<script type="text/javascript">
$(document).ready(function() {
function updateQ2Options() {
var selectedOption = $('input[name="q1"]:checked').val(); // Get the selected value of Q1
if (selectedOption == "1" || selectedOption == "3") {
// Show all options (1,2,3,4)
$('#questionS9 .answer-item').show();
} else {
// Show only options 1 and 2, hide 3 and 4
$('#questionS9 .answer-item').each(function(index) {
if (index >= 2) { // Hide option 3 and 4 (0-based index)
$(this).hide();
} else {
$(this).show();
}
});
}
}
// Run the function when S6 is changed
$('input[name="q1"]').on('change', function() {
updateS6Options();
});
// Run it initially in case Q1 is preselected
updateS9Options();
});
</script>
Then I am facing this error : activateActionLink(); basicThemeScripts.initTopMenuLanguageChanger('.ls-language-link ', 'form#limesurvey'); $('#limesurvey').append(''); updateMandatoryErrorClass(); }); /*]]>*/