amp-form: Submit Form on Input Change
See original GitHub issueCurrently forms require a separate submit button, would be great if it’d be possible to omit the submit button if the form contains a single checkbox. Each click on the checkbox would then trigger an XHR request.
This would enable implementing favorite/bookmark actions directly in AMPs with amp-form.
Example:
<form method="post" action-xhr="https://example.com/bookmark/12345" action="https://example.com/bookmark/12345" target="_top">
<input type="checkbox" id="favorite" checked>
</form>
//cc @mkhatib
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
Documentation: <amp-form> - amp.dev
Allows you to create forms to submit input fields in an AMP document. ... for example, tapping a link, or submitting a form...
Read more >amp html - How to change input submit text value when ...
1 Answer 1 · Use amp-bind and bind the value of your button to a state. Add some start state: <amp-state id="formText"> <script...
Read more >amp-form extended examples and tricks - amp templates
- The form elements which are considered valid and therefore – allowed by AMP validation are <input type=submit>, <input type=text>, <label>, <textarea>, < ......
Read more >How to develop & implement AMP forms on AMP pages
Creating your AMP form HTML ... This part is very similar to a normal form but, instead of having an action attribute, we...
Read more >amp-form - Gitee
Allows you to trigger the form submission on a specific action, for example, tapping a link, or submitting a form on input change....
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
I have a navigation control which is implemented as a select within a form. When the select is changed I use jQuery to submit the form. If I could add on=“change:myform.submit” to the select then I could use this same navigation control on my AMP pages.
What do we think about
on="change:form.submit"
action?