# onFormSubmit is broken?

**URL:** <https://community.hubspot.com/t/onformsubmit-is-broken/100591>\
**Category:** CMS Development\
**Tags:** forms\
**Created:** [February 20, 2024, 9:07pm UTC](https://community.hubspot.com/t/onformsubmit-is-broken/100591 "2024-02-20T21:07:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EHessler](https://avatars.discourse-cdn.com/v4/letter/e/858c86/32.png) [@EHessler](https://community.hubspot.com/u/EHessler)\
**Post date:** [February 20, 2024, 9:07pm UTC](https://community.hubspot.com/t/onformsubmit-is-broken/100591/1 "2024-02-20T21:07:39Z")

</div>

https://www.loom.com/embed/4766d0b765c548a1950a3ff8c49bd306

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [February 20, 2024, 10:56pm UTC](https://community.hubspot.com/t/onformsubmit-is-broken/100591/2 "2024-02-20T22:56:54Z")

</div>

Hey @EHessler - the video was very helpful.

I believe the issue is with the .find() method.

`.find('input[name="credit_score"]').val()`

This will likely always return the very first value out of the available radio options, regardless of which one is selected.

The reason is that **input[name=“credit\_score”]** matches every single radio option, as each option has the same name attribute, so it just returns the first one it sees.

You could try using something that looks for whether the input is selected, i.e.

`('input[name="credit_score"]:checked')`

Hope this helps!
