0

First of all, thank you all for your help :) Really appreciate it as I am a total noob.

Second, I am trying to add info to an HTML form:

Email Address &email=x - Used in the request body The email address of the user >filling out the form. While an email is not required, HubSpot will not create a >contact without a valid email address. Please see this page for more details >about how the email address will be validated.

HS Context &hs_context=x - Used in the request body A JSON formatted block >that contains contextual information for the form submission. See the following >entries for descriptions of the included data, and below for the format of this >parameter.

I am totally lost here in terms of where to add these and also how to add the JSON data. Here's what I have so far:

<!DOCTYPE html>
<html>
    <body>
        <form action="https://forms.hubspot.com/uploads/form/v2/:12345/:1234-432-6575-93456" method="post" enctype="application/x-www-form-urlencoded>
            E-mail <br>
            <input type="email" name="email">
            <input type="submit">
        </form> 
    </body>
 </html>

Here's the JSON code that needs to be added: >The hs_context parameter should > contain the following data, formatted in JSON.Please Note All parameters must be >URL encoded before being passed through the API, including the hs_context >parameter.

{
    "hutk": "60c2ccdfe4892f0fa0593940b12c11aa", 
    "ipAddress": "192.168.1.12", 
    "pageUrl": "http://demo.hubapi.com/contact/", 
    "pageName": "Contact Us", 
    "redirectUrl": "http://demo.hubapi.com/thank-you/" 
}

I've got this far by myself with Googling but now I am completely lost. Help please? :)

Community
  • 1
  • 1
Melanie B
  • 11
  • 2

1 Answers1

0

I don't know hubspot but I think you have to send your request using javascript.

In your javascript you can easyly get your form parameters by adding an id to your field and doing like so :

var email = document.getElementById('email');

and send your request like described here :

Sending a JSON to server and retrieving a JSON in return, without JQuery

Florient
  • 236
  • 1
  • 9