I have created hubspot form and hosted into webpage. And I have tried to customize the code based on our requirement.
Form has FirstName, LastName, Email, and Page Name (custom field - this field hidden). The value will populate dynamically in “Page Name” field from webpage. I have tried to use the below code,
I would execute that code on page load and not on the form submit to make sure the timing is right on that field getting filled in. You can’t backfill a field value after the form has been submitted.
@Kodish_Potti It was a snippet to hopefully give you some ideas on filling in the form on page ready instead of after the form is submitted. You need to make the call from another point in time then when you are currently doing it. Also I think you need to read up on .change() That doesn’t change the value of the form field it allows you to call a function on a ‘change’ event which right now you aren’t doing.