Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form block doesn't trigger submit event #360

Open
chicharr opened this issue Aug 21, 2023 · 0 comments
Open

Form block doesn't trigger submit event #360

chicharr opened this issue Aug 21, 2023 · 0 comments

Comments

@chicharr
Copy link
Collaborator

Expected Behaviour

When a form is submitted a submit event is triggered for the form.

Actual Behaviour

Forms are submitted by a listener on the click event of the submit button. The payload is generated and POST'ed as a json via fetch API. This prevents the triggering of the submit event.
This behaviour prevents other features such as RUM or Conversion tracking to work automatically, as they listen to submit events

Reproduce Scenario (including but not limited to)

https://www.hlx.live/developer/forms

Steps to Reproduce

  1. In your chrome browser open: https://www.hlx.live/developer/forms
  2. Open developer tools -> Console and add a submit listener on the form element. e.g.:document.getElementsByTagName('form')[0].addEventListener('submit', (e) => {console.log('form submitted');})
  3. Scroll down to the sample form in the page, enter some data and click submit button.
  4. Notice that in the browser Console, there is no message form submitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant