# Global form events not working

**URL:** <https://community.hubspot.com/t/global-form-events-not-working/89491>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [September 12, 2023, 8:09pm UTC](https://community.hubspot.com/t/global-form-events-not-working/89491 "2023-09-12T20:09:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CLoder](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@CLoder](https://community.hubspot.com/u/CLoder)\
**Post date:** [September 12, 2023, 8:09pm UTC](https://community.hubspot.com/t/global-form-events-not-working/89491/1 "2023-09-12T20:09:20Z")

</div>

Is there new documenation for global form events? The [old documentation](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options) is incorrect.

For context, I’m trying to use the onFormSubmit to update hidden values:

```lia-code-sample
onBeforeFormSubmit: (form, vals) => {
 const data = calculateDat();
 vals = [...vals, {name: "type", values: data}];
}

```

Acc. to the documentation, `form` should be a JQuery object. It’s not.

I’m using Svelte, and don’t want to inject jQuery for one thing.

Is there any way to update a hidden input with some calculated data?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [September 13, 2023, 12:42pm UTC](https://community.hubspot.com/t/global-form-events-not-working/89491/2 "2023-09-13T12:42:39Z")

</div>

Helllo @CLoder

I don’t believe the callback params have changed, Also these are just callbacks and don’t act as a data modifier before actual submission.

You will have to create a form, add your own logic through javascript and use this API to submit the values: [https://legacydocs.hubspot.com/docs/methods/forms/submit\_form](https://legacydocs.hubspot.com/docs/methods/forms/submit_form)

If you have any doubts, please do ask

---

<div class="post-metadata">

**Author:** ![CLoder](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@CLoder](https://community.hubspot.com/u/CLoder)\
**Post date:** [September 13, 2023, 5:25pm UTC](https://community.hubspot.com/t/global-form-events-not-working/89491/3 "2023-09-13T17:25:40Z")

</div>

\> don’t act as a data modifier before actual submission.

Well that’s a bummer.

the docs give an example:

```lia-code-sample
Examples:
$('input[value="checkbox_1"]').prop('checked', true).change();
$('input[name="firstname"]').val('Brian').change(); 

If not using jQuery:
input.value = value;
input.dispatchEvent(new Event('input', { bubbles: true }));

For Checkboxes:
input.click()

```

What’s the point of that then? Does it only allow me to update values while the form is rendered?
