LaVOZs

The World’s Largest Online Community for Developers

'; html - show different dropdown list from a checkbox selection - LavOzs.Com

I just started to learn to use Flask to build an app. Right now I am stuck at point. I passed 2 different lists as 2 variables to my HTML template from my Flask function. In HTML, I have a checklist and based on if the option is "checked", a dropdown function will show different list1 or list2.

list1, list2

<div class="form-group">
    <label class="switch">Multi-index Rows
        <input type="checkbox" name="Multiindexrow" id="Multiindexrow">
            <span class="slider round"></span>
    </label>
</div>

<div class="form-group">
    <label>Select Your header</label>
    <select name="option" width="500px" id="answer">
    {% for x in list %}
    <option value="{{ x }}"{% if loop.first %} SELECTED{% endif %}>{{ x }}</option>
    {% endfor %} 
    </select>
</div>
Related
Get selected text from a drop-down list (select box) using jQuery
How do I style a <select> dropdown with only CSS?
Show a second dropdown based on previous dropdown selection
jQuery Get Selected Option From Dropdown
How to remove the default arrow icon from a dropdown list (select element)?
Populate checkbox list depending on dropdown selection
Cannot display HTML string
Two html objects (list, input) should generate a third list
jquery- unchecking checkbox on dropdown change not working
How to return list of values selected in dropdown using flask and html