Checkbox support / Dropdowns with multiple selection at a time
See original GitHub issueFirst Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn’t find it.
- I searched the FastAPI documentation, with the integrated search.
- I already searched in Google “How to X in FastAPI” and didn’t find any information.
- I already read and followed all the tutorial in the docs and didn’t find an answer.
- I already checked if it is not related to FastAPI but to Pydantic.
- I already checked if it is not related to FastAPI but to Swagger UI.
- I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
- I commit to help with one of those options 👆
Example Code
from fastapi import UploadFile, File, Request, Query
app = FastAPI()
@app.get('/selections')
async def selection_and(_q : str= Query("regression", enum = ["regression", "classification"]), _p : str = Query("target", enum = ['target', 'response'])):
return({"task": _q, "target": _p})
Description
Is there a way to create checkboxes based on dynamic user inputs with FastAPI and use the checkbox answers to further analyze. Also, looking for dropdowns/search bars with multiple selection to select variables. I am able to incorporate dropdowns with one selection at a time.
Already referred this: https://eugeneyan.com/writing/fastapi-html-checkbox-download/
Best Regards,
Operating System
Windows
Operating System Details
No response
FastAPI Version
0.68.0
Python Version
3.8
Additional Context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Multi-select Dropdown List with Checkbox using jQuery
Multiselect dropdown is very useful to allow the user to select multiple options in a selectbox. Multiple selections of the dropdown list ...
Read more >Multiselect Dropdown List With Checkboxes - multiselect.js
1. Include the stylesheet 'multiselect.css' in the head section of the webpage. · 2. Create a normal 'multiple' select element on the webpage....
Read more >Multi-Select Checkbox Dropdown List - Create And Edit In ...
In this article, you will learn how to create a multi-select checkbox dropdown list in .NET core 3.1 and edit it.
Read more >Dropdown, Multi-select dropdown, Checkbox, & Checklist
To filter the dataset field values based on any value chosen in another dropdown, set filter conditions choosing the field name instead of...
Read more >Drop down multi select check box - jquery - Stack Overflow
How to bind drop down list along with checkbox values and multi select options using Jquery. I am trying to filter the Subcategory...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gauravgund I tried as following for multiple selection. And is working. Swagger-ui supports it as I mention in above comment. Swagger json requires ‘array’ type. For FastApi to generate ‘array’ type, we need to supply Array and for this case List/list worked.
Also you can check this issue. It provides more info on dropdowns.
Could you please elaborate how to integrate it in FastAPI? Swagger UI supports it as show here.
/pet/findByStatus