SOLVED

Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Go to solution
AndrewS
Level 1

Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Hello,

 

I've been trying to find some javascript on these forums that will work but have had no luck. Thought I would reach out here in the hopes that somebody can help me out.

 

Basically the form is going to be used for Subscription Preferences - 8 checkboxes in total.

 

The last checkbox is 'Unsubscribe from all'  -  Once checked, I need this checkbox to un-check any other checkboxes that have been checked by the user.

 

Here is the landing page I'm using the test the form: https://page.elmosoftware.com.au/update_subscription-Centre.html

 

If anybody can help point me in the right direction that would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

MktoForms2 :: Select All Checkbox 

 

Set the Stored Value to * (an asterisk) for whatever field you want to be Select/Unselect All.

 

If you want to invert the logic, so the box acts as an Unselect All when it's checked, use -* as the Stored Value.

 

5e975d18806090003884aa06_selectall_formed.png

View solution in original post

15 REPLIES 15
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

MktoForms2 :: Select All Checkbox 

 

Set the Stored Value to * (an asterisk) for whatever field you want to be Select/Unselect All.

 

If you want to invert the logic, so the box acts as an Unselect All when it's checked, use -* as the Stored Value.

 

5e975d18806090003884aa06_selectall_formed.png

AndrewS
Level 1

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Hi Sanford

 

Thank you for replying so quickly.

 

Just spoke with our marketing team to clarify the functionality.

 

When a user goes to the page, all boxes will be de-selected  -  they can then choose what they want to subscribe to.

 

If they then click on the 'Unsubscribe from all' checkbox  -  this should only de-select any checkboxes they have previously clicked on.

 

So basically it only needs to behave as a "de-select all other checkboxes" function and never as a "select all" function.

 

Is there a dumbed down version of the script that can achieve this?

 

Thanks again

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Nothing needs to be dumbed down in the code, it uses whatever config you have in Form Editor.

 

So if you only use the -* that's a "positive Unselect All". When it's checked, other boxes are forcibly unchecked.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Let me fix one thing in the code, though, hold on... that's an older Pen and need to recreate the form.

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

OK, republished now.

 

Like I said, you can use whatever features you want. * or -* or both. In the demo, one set of Checkboxes has a * Select All, the other has a -* Unselect All.

 

5e975d18806090003884aa06_selectall_formed_pos.png

 

5e975d18806090003884aa06_selectall_formed_neg.png

AndrewS
Level 1

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

You're a legend mate!

 

I'll work on it again tomorrow and update the thread once I get it working.

 

Thanks again!

Priyank_Saraswa
Level 1

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Its not working , while putting "*" in stored value .Also tried opposite using "-*"

Priyank_Saraswa_0-1636493327908.png

 

Jessica_Hendrix
Level 2

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Hey Sanford, 

 

I'm working with Andrew to get this set up and our form isn't showing the same layout as your screen shot below. Where are you editing the stored value?

 

Here is a screenshot of our form for reference: 

Jessica_Hendrix_0-1588222797483.png

Is there somewhere else in Marketo we should be updating the stored values? I know with picklist values you can edit the API for mapping in advanced settings but since this is a boolean field I'm not seeing an option for a stored value. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo Form - Uncheck other checkboxes when 'Unsubscribe from all' box is checked

Hmm, if you don't use a checkbox set (Checkboxes type) then there isn't a relationship between the fields. (Neither visually/in the DOM, nor under the hood.)

 

My screenshots are from a Checkboxes field.

 

It is possible to wire up individual Checkbox (no -es) field together, to create a sort of pseudo-grouping.  But that isn't the way I would do it. Rather, I'd have one visible Checkboxes field that splits its values into multiple hidden, Boolean fields when submitting.