SOLVED

Re: Need help w/JS for Marketo Form

Go to solution
Guitarrista82
Level 6

Hello,

 

This should be simple enough, but, alas, not for me. I have tried figuring out the correct JS code but am failing miserably. 

 

I've embedded a form on this landing page: https://promos.ovstravel.com/redweek-retail-agent-trigger-page.html

 

What I'd like to happen is that when either "Yes" or "No" is selected for "Is the member a Property Owner" field, I want the other checkbox to remain unchecked. What I'm seeing now is that both boxes can be checked.

 

Additionally, the field below that (Agent Trigger Email To Be Sent) is dependent on the field above, and I don't want those dependencies to be affected. For example, I made it so that if "Yes" is selected for Property Owner, the "RedWeek Agent Sweepstakes Email to Owner" will be shown, and if "No" is selected, the "RedWeek Agent Sweepstakes Email to Non-Owner" will be shown. And, if neither "Yes" nor "No" are selected, both emails will be shown.

Guitarrista82_0-1690335154710.png

 

Can someone please share the code framework I should use to make this happen?

 

Thank you,

LK

 

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

You don't need JS. Those should be Radio buttons, not Checkboxes, if they're mutually exclusive.

View solution in original post

4 REPLIES 4
Vivre
Level 2

Hi there, is it a boolean field? Could you just have a drop down yes or no, or 1 single check box where ticked = yes, and not ticked = no

Guitarrista82
Level 6

Thanks Vivre, that's another good option!

SanfordWhiteman
Level 10 - Community Moderator

You don't need JS. Those should be Radio buttons, not Checkboxes, if they're mutually exclusive.

Guitarrista82
Level 6

That worked perfect, thanks Sanford!