La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
Hubspot form: programmatically set field value via jQuery
I'm having exactly the same issue. I can successfully set the initial value of my fields but as soon as I click on and out of one of the fields all pre-set values get deleted again.
Does anyone have any news on this issue? I am using the code from the Documentation, although I added "$form" as second argument in the jQuery selector, because otherwise nothing would happen.
Hubspot form: programmatically set field value via jQuery
@Derek_Gervais I'm also having this problem and would really love some help with it.
My use case is leveraging the google maps API to provide autocomplete functionality for the address field. Everything works fine except for that the HS form code keeps clearing the autocompleted values. Tried every variation of jQuery we could think of, but HS keeps clearing the value.
As a general rule, it's better to create a brand new forum post than to post on an older one (>1 year old). Issues from greater than one year ago have usually been resolved, and aren't directly related to new/current issues.
That said, I'm happy to dive into whatever is going wrong here. Can you post a link to the page you're referring to so that I can take a closer look?
The error is accurate here; you need to include jQuery to get the full functionality of the form embed code. jQuery is included on HubSpot pages by default, but may not be included on yours.
The Document.load method isn't the best event for this; that event fires when the DOM is loaded, but HubSpot forms are loaded dynamically by the form embed code. You should put the form field related code in the built-in onFormReady callback:
Hubspot form: programmatically set field value via jQuery
Derek,
I used Document.load method from Javascrip to make sure it is loaded. I also both $ and JQuery. Apparantly the Document is loaded, but doesnt have all HTML5 attributes!
Hubspot form: programmatically set field value via jQuery
I have the same issue, I'm trying to write on an input:
$(‘input[name=“firstname”]’).val(“damiano”).change();
but it doesn't:disappointed_relieved: work.
Hubspot form: programmatically set field value via jQuery
Hello guys,
I’m having some problems with forms and its values, I know it’s not the same thing discussed here but I’d like to know if there’s any way that we can achieve what we need.
The story is the following:
So basically, we’ve built custom private pages for our client’s customers. The thing is that there are many customers groups/segments and we created one private page per group.
So, in order to join these pages, the users must fill out a form inside HubSpot and one of the form fields is called “Security Token”, a single-line text field.
Depending on the group they belong to, the customers will enter a different “Security Token”, with this “token”, we identify the segment where they belong to.
So, for internal purposes, we need to pass the “Security Token” field value into a string parameter in the URL of the page that they’re redirected.
An example:
The user fills out the form (COS Page and HubSpot form), and its token is “TOKEN101”
Form is submitted and it’s redirected to the desination page.
I modified it in order to pull only the data we need but I think I’m missing out something. With these changes, the form doesn’t redirect, it works because the data is sent, but the redirect doesn’t happen so I think it’s something related to the variables using the parameter “redirectUrl”