Skip to content
  • home
  • portfolio
  • web design journal
  • blog
    • adventure
    • san diego
    • projects
    • website design
    • code notes
Blog Web Dev Passing a Hidden Field Through a Hubspot Form

Passing a Hidden Field Through a Hubspot Form

By Forrest Smith - Drempd.com

A company I work for has many events that they attend and they would like to have a hubspot form gather data for each event, but of course they don't want to make a separate form for each one.

1. Step 1 - Create a Hidden Field on Your Hubspot Form

2. Step 2 - Populate the Form With the Data You Want Via Javascript

Use Javascript to update the value of the hidden form field to whatever you want (and of course the portalId and formId are set to your unique account and form):
<script>
   hbspt.forms.create({
      region: "na1",
      portalId: "12345678",
      formId: "12345678",
      onFormReady: function($form){
         $form.find('input[name="event_name"]').val('Brian').change();
      }
   });
</script>

Posted on June 22, 2022August 28, 2025 in Web Dev

drempd | san diego, ca


home contact

adventures san diego projects stream website design

portfolio resume san diego web design freelance web designer

custom web design responsive web design website maintenance