SOLVED

Re: Submitting Form if only 1 field is completed

Go to solution
Ajay_Mamgain4
Level 1

We are creating a new subscription page where we want user to select atleast one checkboxes which we will be initially unchecked and on successful completion form is submitted to us. Can anyone help me out with this ?

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

We are using three separate Checkboxes.

There are two different checkbox-related widgets in Marketo, the checkbox group (Checkboxes) and the individual checkbox (Checkbox) so that still isn't totally clear!

But at any rate the solution is like so: MktoForms2 :: Checkboxes Min/Max Checked

View solution in original post

14 REPLIES 14
SanfordWhiteman
Level 10 - Community Moderator

At least one of a group of Checkboxes widget type?  Or multiple independent ​Checkbox ​types?

Ajay_Mamgain4
Level 1

Thank you for the reply... We are using three separate Checkboxes. We are looking to create a validation rule where user needs to select atleast one of them in order to successfully submit the form. Below are the values which are initially unchecked and we want to force user to select atleast one of them.

  1. Events
  2. Research
  3. Other Promotional
SanfordWhiteman
Level 10 - Community Moderator

We are using three separate Checkboxes.

There are two different checkbox-related widgets in Marketo, the checkbox group (Checkboxes) and the individual checkbox (Checkbox) so that still isn't totally clear!

But at any rate the solution is like so: MktoForms2 :: Checkboxes Min/Max Checked

Raushan_Jha
Level 1

Hi sanford,

I am trying to use your script on my form MktoForms2.loadForm("//app-ab39.marketo.com", "249-JRI-388", 1016);

where i have created one landing page and then dragged the HTML where i put this code but it is not running.

Can you please suggest me where i am going wrong??

My code pen link is https://codepen.io/raushan94/pen/abzarGR 

SanfordWhiteman
Level 10 - Community Moderator

Your checkboxGroups config section bears no relationship to the fields on your form. It looks like you just lifted it from my CodePen, no reason that would work w/your fields.

Ajay_Mamgain4
Level 1

Apologies for the confusion the fields are individual checkbox. Thank you for the reply and providing the solution this is what i was looking for i will disable the max check limit as user can select all three of them if required. Thanks Again for the solution.

SanfordWhiteman
Level 10 - Community Moderator

You don't have to disable anything, just set the max to Number.POSITIVE_INFINITY.

Ajay_Mamgain4
Level 1

Thank you for the tip. However, somehow the code is not working for my form. Below is my form details could you please help me out ?

<script>MktoForms2.loadForm("//app-ab02.marketo.com", "920-WUD-698", 198);</script>

<form id="mktoForm_198">

SanfordWhiteman
Level 10 - Community Moderator

I need to see the page you're running this on.

Ajay_Mamgain4
Level 1

I'm currently editing on the codepen itself which you have shared earlier to see if it's working fine or not. Could you share the steps or guide me to resource where i can see how to add the JS in my landing page.

SanfordWhiteman
Level 10 - Community Moderator

You would have a new CodePen URL, please share that.

Ajay_Mamgain4
Level 1

Sure. Marketo Form

SanfordWhiteman
Level 10 - Community Moderator

Er... I kinda thought you had customized the code for your form at least a little? It needs to have your form fields in it, obviously. Like so: MktoForms2 :: /nation/44707

Ajay_Mamgain4
Level 1

Thank you so much for your patience everything is working fine now as expected and I realized what i did wrong. Again thankyou for assistance