i want the checkboxes to stay in the left div with its previously checked values even after generate button is submitted.
I divided page into two(similar to streamlit sidebar).
first user will check the checkbobes and then submit the generate button, a tabble and picture is shown in right side div which is from generate funtion in python. here after this checkboxes goes away after button submit. i want them to stay and le the user change it anytime and work accordingly.
Fronth end is not my cup of tea.
I have started to learn so please help.
@app.route('/')
def index():
table_names = get_table_names()
return render_template('combined.html', table_names=table_names,db_name=database)
@app.route('/generate', methods=['POST'])
def generate():
import time
selected_tables = request.form.getlist('table')
......
return render_template('combined.html', tables=[data_dict.to_html(classes='data')], titles=[''],graph_done=graph_done)
this is combined.html
<body>
<div id = "container">
<div class="left">
<form method="post" action="/generate">
{% for table_name in table_names %}
<input type="checkbox" name="table" value="{{ table_name }}" >{{ table_name }}<br>
<input type="hidden" name="selected_tables" value="{{ selected_tables|join(',') }}">
{% endfor %}
<input type="submit" value="Generate">
</form>
</div>
<div class="right">
{% if tables %}
{% for table in tables %}
{{ titles[loop.index] }}
<table class="table-container" style="margin: 0 auto;"> <!-- Center the table -->
{{ table|safe }}
</table>
{% endfor %}
{% endif %}
</div>
</div>
</body>
i want the checkboxes to stay even after button is submitted.