worker-dom icon indicating copy to clipboard operation
worker-dom copied to clipboard

Add support for HTMLFormElement.submit()

Open mbelchin opened this issue 5 years ago • 2 comments

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.

mbelchin avatar Aug 22 '19 13:08 mbelchin

Hi @mbelchin trying to understand the user need here. Are you trying to implement something like amp-live-list here?

https://amp.dev/documentation/examples/components/amp-live-list/

nainar avatar Sep 16 '19 22:09 nainar

Hi @nainar,

the idea is similar but amp-live-list does not work for our use case, because of two reasons:

  1. the period of time for polling is to high, we should have something between 1sec to 3 secs maximum.
  2. We don't want to tap, click or any other type of event in order to get the updates.

Imagine a chat: you send messages and you expect to receive new messages in from the other end every X seconds.

Regards

mbelchin avatar Sep 18 '19 07:09 mbelchin