js code custom html

Confluence User - 05 Aug, 2024

i put a js code inside custom html but it does not running correctly 

i use a downloaded joget at my windows 

this is the code 

<html>
    <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script
    </head>
    <body>
        
<script type="text/javascript">
    $(document).ready(function() {
        // Function to update options in the second select box
        function updateSelectBox2() {
            var selectedValue = $('#to').val();
            $('#approversList option').show(); // Show all options initially
            $('#approversList option').each(function() {
                if ($(this).val() === selectedValue) {
                    $(this).hide(); // Hide the selected value from selectBox1
                }
            });
        }

        // Event listener for changes in the first select box
        $('#to').change(function() {
            updateSelectBox2();
        });

        // Initial call to update selectBox2 on page load
        updateSelectBox2();
    });
</script>
    </body>
</html>

customhtml;js

1


06 Aug, 2024
confluenceUser
confluenceUser

Hi, this appears to be a duplicate of custom html js code.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print