Manipulate form script jQuery on hubpot page

forms

#1

Hi all,

I'm trying to manipulate a HubSpot form that is within a HubSpot page.
The manual on the developers website of HubSpot is only for a embed code and not for the HubSpot page forms.
(reference: https://developers.hubspot.com/manipulating-forms-with-jquery)

How can I manipulate a existing HubSpot form with jQuery like the code below without creating it? If posible, I don't want to embed the custom code script manually on the page on that place and still want to use the form selector within HubSpot.

hbspt.forms.create({ 
    portalId: 'XXXXXX',
    formId: 'aa8b5b4a-62ac-461b-a387-XXXXXXXXXXX',
    onFormReady($form, ctx){
   		$('input[value="checkbox_1"]').prop('checked', true).change();
    	$('input[name="firstname"]').val('Brian').change();   
   	}
});

#2

Hi @Indra,

It's not currently possible to do that with a form built into a HubSpot page, but you could add some custom Javascript to listen to the global form events instead: