# onFormSubmit input values

**URL:** <https://community.hubspot.com/t/onformsubmit-input-values/37046>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [May 10, 2021, 9:27pm UTC](https://community.hubspot.com/t/onformsubmit-input-values/37046 "2021-05-10T21:27:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccalbreath](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ccalbreath/32/69256_2.png) [@ccalbreath](https://community.hubspot.com/u/ccalbreath)\
**Post date:** [May 10, 2021, 9:27pm UTC](https://community.hubspot.com/t/onformsubmit-input-values/37046/1 "2021-05-10T21:27:14Z")

</div>

I have a form embedded into a web page on our external site. I’m using the input from the form to construct an API call, which looks like this:

```lia-code-sample
"data": JSON.stringify({
 "locate": {
 "address": ('input[name="full_address"]').value,
 "zip": ('input[name="zip"]').value,
 "service_class": 81548669
 },
 "contact": {
 "email_address": ('input[name="email"]').value,
 "first_name": ('input[name="firstname"]').value,
 "last_name": ('input[name="lastname"]').value,
 "phone_number": ('input[name="phone"]').value

```

However, I’m not getting the input text from the form. How can I access the entered values of each form field?

TIA

---

<div class="post-metadata">

**Author:** ![ccalbreath](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ccalbreath/32/69256_2.png) [@ccalbreath](https://community.hubspot.com/u/ccalbreath)\
**Post date:** [May 10, 2021, 10:06pm UTC](https://community.hubspot.com/t/onformsubmit-input-values/37046/2 "2021-05-10T22:06:26Z")

</div>

Answered my own question:

```lia-code-sample
"data": JSON.stringify({
 "locate": {
 "address": jQuery('input[name="full_address"]').val(),
 "zip": jQuery('input[name="zip"]').val(),
 "service_class": 81548669
 },
 "contact": {
 "email_address": jQuery('input[name="email"]').val(),
 "first_name": jQuery('input[name="firstname"]').val(),
 "last_name": jQuery('input[name="lastname"]').val(),
 "phone_number": jQuery('input[name="phone"]').val()

```

---

<div class="post-metadata">

**Author:** ![sharonlicari](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sharonlicari/32/101479_2.png) [@sharonlicari](https://community.hubspot.com/u/sharonlicari)\
**Post date:** [May 11, 2021, 11:44am UTC](https://community.hubspot.com/t/onformsubmit-input-values/37046/3 "2021-05-11T11:44:22Z")

</div>

thanks for sharing @ccalbreath

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [May 13, 2021, 12:55pm UTC](https://community.hubspot.com/t/onformsubmit-input-values/37046/4 "2021-05-13T12:55:09Z")

</div>

Hi @ccalbreath,  
Please try the below code:  
Please tried this one :  
JSON.stringify({  
“locate”: {  
“address”: $(‘input[name=“full\_address”]’).val(),  
“zip”: $(‘input[name=“zip”]’).val(),  
“service\_class”: 81548669  
},  
“contact”: {  
“email\_address”: $(‘input[name=“email”]’).val(),  
“first\_name”: $(‘input[name=“firstname”]’).val(),  
“last\_name”: $(‘input[name=“lastname”]’).val(),  
“phone\_number”: $(‘input[name=“phone”]’).val()  
Hope this helps!  
If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.
