Skip to main content
Dennis_Thomsen
Level 2
March 9, 2022
解決済み

Remove form fields on specific page(s)

  • March 9, 2022
  • 3 の返信
  • 2381 ビュー

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

このトピックへの返信は締め切られました。
ベストアンサー SanfordWhiteman

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.

3 の返信

SanfordWhiteman
Level 10
March 9, 2022

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
March 10, 2022

Hello Sanford,

 

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

 

BR
Dennis

SanfordWhiteman
Level 10
March 10, 2022

Great!