How to display field values depending on what has been selected on a previous form

Charlotte_Berth
Level 2

How to display field values depending on what has been selected on a previous form

Hi,

I am preparing 2 landing pages for my preference center. The first landing pages will enable the contacts to select the newsletters from their country. The second landing page will enable the contacts to select the newsletters from other countries. 

In the form of my second landing page, I don't know how to only display the countries that have not been selected on the first landing page.

Moreover, I don't know how to display the countries by alphabetical order and have the contacts select Yes/No. Does any one has an idea?

Many thanks

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: How to display field values depending on what has been selected on a previous form

Some amount of JS is going to be necessary for this. Not a lot, by any means. But you can't get away with just the UI-driven Form Editor logic.

 

To display only the countries not selected, you'll need to pass the country that was selected in the query string of the 2nd page, i.e. ?Country=UK. Then have that query param Autofill a Hidden custom field (call it Primary Form Country or suchlike). Use Visibility Rules so Primary Form Country determines what other values are shown.

 

The JS to copy any value(s) to the query string of the Thank You URL is here: MktoForms2 :: Append submitted values to TY URL v1.0.0 . You would just put your Country in the config like

const appendFieldsToTYQuery = [
  {
     mktoField: "Country"
  }
];
  

 


Moreover, I don't know how to display the countries by alphabetical order and have the contacts select Yes/No. Does any one has an idea?

I don't really know what you mean here (sounds like a Checkboxes group) but Marketo doesn't alphabetize anything for you, it's up to how you add the options to the form.