APIs & Integrations

krs360
Participant

Is it possible for me to use cookies/the API to prevent subsequent forms being shown?

SOLVE

Hello all,

 

Another dev related question!

 

I have HS linked to the Wordpress site of a client and they have a number of forms which allows registration into the business, they're all embeded and essentially the just link to one another.

 

The main portal has a kind of dashboard/overview which means someone could technically go into the third form and enter those details without entering in forms one and two. The only really DIRTY way I can think of doing it is to have a required field/property on form two which only gets completed when form one is submitted but as you can't hide required fields someone could just type anything into that box and bypass that.

 

Could it be done by querying the completed forms on the API? Or even a completed property from the contact that was completed on the previous form(s)? If anyone would be kinda enough to throw in a one liner on the API query to access a specific form it would give me a starting point to try and understand it a bit better.

 

Many thanks.

0 Upvotes
1 Accepted solution
krs360
Solution
Participant

Is it possible for me to use cookies/the API to prevent subsequent forms being shown?

SOLVE

Hello,

 

Thanks for the reply.

 

I'll post this follow-up because it might be useful to someone else who is trying to make sure content is completed in a set order (forms or whatever else.)

 

My HS forms are embedded within a client portal that requires a username/password to see the content of.

 

I've resolved the original issue with people completing forms willy nilly by setting a field on the CRM hubspot via the API after the first form is submitted.

The second form (which you're automatically taken to after submitting the first, so it looks like a multistep form) queries the API to see if the firstformcompletedfield has a value and if not it'll throw and alert and redirect the person back to the form they need to complete.

 

It's not a perfect solution but it works.

 

One question I did have for you was that I'm pretty sure I read somewhere on the help pages that you need to be on professional or above in order to manipulate the hubspot forms using javascript as suggested in your response?

 

 

 

View solution in original post

3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

Is it possible for me to use cookies/the API to prevent subsequent forms being shown?

SOLVE

Hey @krs360,

 

Just to ensure that we're on the same page, are you looking to set the required property on form 2 with the data passed from form 1? If that's what your team is looking for, you can do so by customizing the form embed code: How to customize the form embed code

 

i.e. 

    $('input[value="checkbox_1"]').prop('checked', true).change();

Having said that, based on the use case your shared, I would suggest customer to explore the option of using multi steps form. 

0 Upvotes
krs360
Solution
Participant

Is it possible for me to use cookies/the API to prevent subsequent forms being shown?

SOLVE

Hello,

 

Thanks for the reply.

 

I'll post this follow-up because it might be useful to someone else who is trying to make sure content is completed in a set order (forms or whatever else.)

 

My HS forms are embedded within a client portal that requires a username/password to see the content of.

 

I've resolved the original issue with people completing forms willy nilly by setting a field on the CRM hubspot via the API after the first form is submitted.

The second form (which you're automatically taken to after submitting the first, so it looks like a multistep form) queries the API to see if the firstformcompletedfield has a value and if not it'll throw and alert and redirect the person back to the form they need to complete.

 

It's not a perfect solution but it works.

 

One question I did have for you was that I'm pretty sure I read somewhere on the help pages that you need to be on professional or above in order to manipulate the hubspot forms using javascript as suggested in your response?

 

 

 

WendyGoh
HubSpot Employee
HubSpot Employee

Is it possible for me to use cookies/the API to prevent subsequent forms being shown?

SOLVE

Hey @krs360,

 

That's a great question and you're spot on!

 

As stated on the documentation,

Note: These options are only available for forms created using the marketing form builder available with a paid Legacy Basic, Professional, or Enterprise marketing subscription. Other forms, such as collected forms or lead flows, do not support these customization options. 

0 Upvotes