SOLVED

Remove form fields on specific page(s)

Go to solution
Dennis_Thomsen
Level 2

Remove form fields on specific page(s)

Hello,

 

We use a global form on multiple guided template landing pages where forms are inserted via the lp editor. For a specific landing page we want to use same global form but wish to remove a couple of fields (set as mandatory in the form editor).

 

I tried searching the community but couldn’t find a solution. I assume this can be done with javascript but I’m not sure how? Can any one point me in the right direction on how to achieve this?

 

BR
Dennis

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Remove form fields on specific page(s)

If they're required fields, you can't just remove them with JS.

 

But you can manage their visibility with Visibility Rules. A field that's marked Required but not shown due to VRs is not required - which is good.

 

You can in turn base the visibility on another Hidden field that's used only for Visibility Rule management. (It has to exist in Marketo, but has no meaning on the server, it's only used on the browser side.)

 

For example, the field could be called Field Visibility Manager.

 

The VRs say If field Field Visibility Manager is "Special Page" then Hide field Country.

 

You set the Field Visibility Manager value itself using the Forms 2.0 setValues method, only on your special page.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Remove form fields on specific page(s)

If they're required fields, you can't just remove them with JS.

 

But you can manage their visibility with Visibility Rules. A field that's marked Required but not shown due to VRs is not required - which is good.

 

You can in turn base the visibility on another Hidden field that's used only for Visibility Rule management. (It has to exist in Marketo, but has no meaning on the server, it's only used on the browser side.)

 

For example, the field could be called Field Visibility Manager.

 

The VRs say If field Field Visibility Manager is "Special Page" then Hide field Country.

 

You set the Field Visibility Manager value itself using the Forms 2.0 setValues method, only on your special page.

Dennis_Thomsen
Level 2

Re: Remove form fields on specific page(s)

Hello Sanford,

 

That worked perfectly - great solution. Thanks for your help 🙏

 

BR
Dennis

SanfordWhiteman
Level 10 - Community Moderator

Re: Remove form fields on specific page(s)

Great!