SOLVED

Re: Hiding the Submit Button based on the Drop Down Selection

Go to solution
incitedigital
Level 1

Re: Hiding the Submit Button based on the Drop Down Selection

I think I see the issue.  The checkboxes we had setup were of the type checkbox, not checkboxes.   Now I need to set it so that a value must be selected from each set of checkboxes. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Hiding the Submit Button based on the Drop Down Selection

Yes, a Checkboxes set writes a semicolon-delimited string of values to a single Marketo field.

incitedigital
Level 1

Re: Hiding the Submit Button based on the Drop Down Selection

Thank you again!   I switched the checkbox into a checkboxes field type and modified the script to an empty string.  The name of the field is mktoEventstest.  Unfortunately, the submit button is not disabled by default.  I am looking to make it so that the user has to select at least one option to enable the button.    Also, how would I modify the script so that I can have the user select at least one item from two sets of checkboxes?  Thanks in advance for your guidance.  

 

  const submitButtonVRs = {
         hideButtonIf : {
             "mktoEventstest" : [""]
         },
         dontDisableButton : false,
         dontDisableMktoForm: false
   };
  

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Hiding the Submit Button based on the Drop Down Selection

Can you post a link to your page, please?

incitedigital
Level 1

Re: Hiding the Submit Button based on the Drop Down Selection

Thanks for the response. 

I've adjusted the code to include the following: 

 

 showButtonIf : {
"mktoEventstest" : ["[events]","[newsletters]","[announcements]","[marketing]"]
}

 

 

The button enables when I select only one option, however it is disabled if there are more than one option selected. 

 

What I'm trying to accomplish is that the user needs to select at least one option for preference type and at least one option for pillar before the submit button is enabled.   I will convert the pillars into a checkboxes component but trying to figure out where I am wrong in the current script.  

 

Thanks again!

mikestlouis
Level 2

Re: Hiding the Submit Button based on the Drop Down Selection

Take it this has never been solved/fix? I'm trying to just make it so if a field (email specifically) is blank the button is a no show. Works great in the CodePen, but the minute you bring it into Marketo world = it no worky.