Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask: editing a submitted form
#1
Hi!
I am making a form which has a many fields. Some are radio buttons and dropdowns. Once i store the value of the input in my database, how can i make it so that the state of the radiobutton and dropdown is updated when i click on edit page?

I have tried this, but it does not work:
                    <div class="form-row">
                        <div class="col-12">
                        <label for="tr_level">Level</label>
                        <select name="tr_level" value="{{ pt_update.tr_level }}" class="form-control">
                            <option>I A</option>
                            <option>II B</option>
                            <option>III C</option>
                            <option>IV D</option>
                            <option>V E</option>
                        </select></div>
I have not been able to find a way to update the radio-button state..
Have been stuck here for quite a bit. Any help would be very useful! Thanks.
Reply
#2
This helped: https://stackoverflow.com/questions/2945...a-template
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask Basics request.form ifigazsi 0 1,811 Feb-09-2021, 09:05 AM
Last Post: ifigazsi
  Flask request.form ifigazsi 2 3,747 Feb-02-2021, 11:56 AM
Last Post: buran
  got some problem with flask signup form. darktitan 1 2,272 Aug-30-2019, 06:05 AM
Last Post: aligoren
  how i save the html form to flask database mebaysan 1 7,314 Feb-07-2019, 12:56 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020