question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amp-form auto submit: option/action to reset form/inputs

See original GitHub issue

Given a form which auto-submits a text input:

  <form id="todo"
        method="POST" 
        action-xhr="/advanced/todo/add" 
        target="_blank"
        on="submit-success:todos">
    <input type="text" name="todo" on="change:todo.submit">
  </form>

It’d be great if there’d be a way to clear the input field on successful form submit.

Please also see comments in https://github.com/ampproject/amphtml/issues/7688 regarding possible approaches for this issue.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:43 (31 by maintainers)

github_iconTop GitHub Comments

2reactions
ericlindley-gcommented, Oct 18, 2017

@ankur0890 and @namtenten — I don’t think anything has been built in the meantime to solve this, but I’d be curious to hear about your use cases to make sure it’s factored into whatever approach is used here. Thanks!

/cc @cvializ for visibility

1reaction
IamAltacommented, Aug 20, 2018

@dev-drprasad @aghassemi @cvializ Thanks for the reply, cvializ.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reset Fields on AMP Form Submission - Stack Overflow
You can use the clear action to reset all fields in a form: <form id=myForm> <input> </form> <button on="tap:myForm.clear">Clear ...
Read more >
amp-form auto submit: option/action to reset form/inputs
Given a form which auto-submits a text input: <form id="todo" method="POST" action-xhr="/advanced/todo/add" target="_blank" ...
Read more >
Documentation: <amp-form> - amp.dev
Allows you to create forms to submit input fields in an AMP document.
Read more >
Remix Single: Clearing Inputs After Form Submissions
After a form submission completes, you often want to clear out the form fields. You can `useTransition` to know when to reset the...
Read more >
Инструкция Honeywell UDC3500 (en) - honeyvell.energy
Table 4-19 Digital Input Option Action on Contact Closure ... Dual 2 Amp Relays (Form A) (Heat/Cool, Pos Prop, TPSC, Relays 1 &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found