Welcome to the LimeSurvey Community Forum

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

Error

  • satyam123
  • satyam123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
15 hours 55 minutes ago #268962 by satyam123
Error was created by satyam123
Hi,

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(); }); /*]]>*/

I am not able to fixd this error.
Please help.


Thank You,

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose