Search code examples
pythonformsflaskjinja2

Why isn't request.form.get() getting the form input?


my codeWhy do I get all the info from my table instead of only the item selected?

I expected for the {{events.name}} to be retrieved by request.form.get("eventname") so that I can use it to delete the event from the table


Solution

  • You have assigned the option value to the entire list as <option value="{{events}}">{{event.name}}</option>. It should be corrected to <option value="{{event.name}}">{{event.name}}</option>.