Set default form values on page editor

Currently, there are settings in the web/landing page editor that can override an embedded form such as styling and submission notification.

We’d appreciate if we can isolate or set a prefilled or default value on the page editor so that it will only apply to the page and not directly to the base form.

This will significantly reduce the need to duplicate forms just for the sake of prefilled values. This will also make more sense when buttons are set to redirect to pages instead of using the injection method via URL.

I’m also not sure if this is just me but we used to have the option to disable choices in form dropdowns in the page editor to limit the choices and apply it only to the page only. Same goes for custom sorting that is isolated to the form use on a specific page. Now, both options are gone.

Again, to be clear. We are not referring to setting the default values in the forms editor. We are trying to override it and set it on the web or landing pages on where the form is embedded in - via that page’s editor/builder.

For example - form 1’s campaign country field’s default value in the forms editor is US. However, if using form 1 in a EU campaign using a EU landing page - instead of duplicating the same form - we simply override the campaign country field’s default value to EU through the landing page editor when embedding the same form.

Hey @LeonardoDVinci :waving_hand: and Happy Tuesday!
Thanks for reaching out to the HubSpot Community!
I’d love to put you in touch with our Top Experts: Hi @Anton, @sylvain_tirreau and @evaldas do you have suggestions to help @LeonardoDVinci, please?
In the meanwhile @LeonardoDVinci, here are some documentation for reference:
- HubSpot forms
- Module and theme fields
Have a fantastic day!
Bérangère

Hey @LeonardoDVinci,

the styling options should be handled by the theme, not by modules. So best practise is to not touch the form styling options of the form module at all.

To define a default, you have three options:

  1. Hardcode the form styling into your theme
  2. Add form styling options to the theme and put them as CSS into your theme CSS file(s)
  3. Create a custom CSS file which will contain your form styling and put it in the portal settings

Regardless which approach you decide to do, you will need to clean up all form styles added to every form on every page after implementing one of those options.

As for the disable choices and sorting I have two one assumptions:

  1. It works only for the legacy forms (the old ones)
  2. It got removed entirely as it creates non-accessible variations of the property, bloats the whole system and shouldn’t be done on page/form level but rather in the form editor to keep it consistent.

Edit: Just checked it - it seems that it got removed for the new forms.

Hope this helps

best,

Anton

p.s. If you need developer help, I’m happy to help

Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.

not sure if this is clear, but this post is not about styling, its about alternatives in prefilling your forms.
Instead of the usual script or URL inject, we’d like to have an option to prefill the form on the builder.

Hey @LeonardoDVinci,

not sure if I get it correctly. If you could provide a screenshot or something (please no link), it would help a lot.

If you mean setting the default value of a field during the form building process in the form builder, you can use the default value of each property


legacy forms


new forms

but this has to be done in each individual form as setting default values on something like property level is a bad UX (user would need to delete it first) as well as make the property kinda obsolete

best,

Anton

Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.

Hey @LeonardoDVinci,
You can handle form styles by Hardcode styles in the theme file
To set default form styling, HubSpot currently supports three reliable approaches:
1. Define form styles directly in the theme CSS
2. Expose theme fields that output CSS for forms
3. Use a global custom CSS file in portal settings

If you move to any of these, existing form-level and module-level styles should be cleaned up, otherwise they will override the theme styles.

Regarding disabled dropdown options and custom sorting, as I know this is not supported in the new forms editor.

@Anton I know that the forms editor has default value and this is not what this post is about. What I’m asking for is setting this default value on where the form is embedded in - in the web/landing page editor/builder. This should override the default values set on the form, similar to how it should work if you code it through the URL. I hope that we are on the same page here.

Hey @LeonardoDVinci,

totally get that.
Unfortunately it’s not possible to set the default value neither on page nor the form level, only on property level.
This means you’d need to clone properties - something I highly advise not to do as this will bloat the CRM.

A few potential workarounds:

  • inject the default value via JavaScript. I’d recommend to create a custom module with a form and a text field (not rich-text) per property you’d like to overwrite per form, write the whole logic and put the replacement/default values into the code
  • hide the form field and inject the value by URL params

hope this helps

best,

Anton