首页 > 解决方案 > Get Data from non-input element in Flask

问题描述

This is my Bootstrap button which works as dropdown.

<button class="btn btn-outline-danger dropdown-toggle categoryButton" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Category</button>

I am using, flask to get the value . As it so stands, I want to get the value of the button, as it changes dynamically as I select differenet options from drop down list. The values I select on drop down is reflected on the button, and now I want to grab it on Flask. But I could not find any way to get value of the button from Flask. I tried giving name attribute to the button and did this on Flask

category  = request.form.get('category')

But it returns none.Any help regarding this issue? Or should I go for another approach? Any help ?

标签: flask

解决方案


推荐阅读