ampproject / ampproject/worker-dom

Add support for HTMLFormElement.submit()

Open
#625 2 comments 6 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

According to https://github.com/ampproject/worker-dom/blob/master/web_compat_table.md

HTMLFormElement.submit() is not yet supported.

Would be great to add support for that, this way we could do things like:

```
window.setInterval( () => {
document.getElementyById('my-form').submit();
}, 3000 );
```

And if that `amp-form` is a GET form you have the possibility of getting data coming back from server every X seconds.

More info: https://stackoverflow.com/questions/57571092/how-to-use-amp-script-to-submit-a-form-and-get-data-from-server-every-x-seconds/57575347#57575347

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start by reading web_compat_table.md and locating the HTMLFormElement implementation and its existing form behavior. Trace how form submission is represented in the worker DOM, then define completion as HTMLFormElement.submit() working for the described GET-form polling use case and update the compatibility documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.