st.form should create proper <form> element (with "enter to submit" support)
See original GitHub issueFrom a user request here: https://discuss.streamlit.io/t/enter-key-press-to-submit-st-form/16939
The request is correct: we don’t currently use <form>
tags in st.form
HTML output. We should consider it!
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:15
- Comments:6
Top Results From Across the Web
Submitting a form by pressing enter without a submit button
Save this answer. Show activity on this post. IE doesn't allow pressing the ENTER key for form submission if the submit button is...
Read more >Enter key press to submit st.form - Using Streamlit
Just wondering why pressing the enter/return key in a Streamlit form ... st.form should create proper <form> element (with "enter to submit" support)....
Read more ><input type="submit"> - HTML: HyperText Markup Language
A string indicating the HTTP method to use when submitting the form's data; this value overrides any method attribute given on the owning...
Read more >HTML 5.2: 4.10. Forms - W3C
Finally, to make the form submittable we use the button element: ... to specify the URL of the service that will handle the...
Read more >How to Customize the Submit Button with CSS - Jotform
UPDATE: Try the Form Designer video course to create fantastic Submit ... Submit buttons in web forms should also feel right because that's ......
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 Free
Top 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
This could be solved by either manually setting a property to the st.form_submit_button to respond to the Enter key input(like st.form_submit_button(label=“Submit”, listen=True) or main=True, enter_to_submit=True… naming things is hard. Throwing an exception if multiple submit buttons in the form have this value set to True.
Or we grab the last entry of all submit buttons in a specific form and always assign that button as the designated listener for the Enter key input.
For now as a workaround you can use 2 more Tabs + Enter to submit (when currently in your final text_input).
“Enter to submit” is very important in a form.