Click unsubscribe and uncheck all checkboxes

Anonymous
Not applicable

Click unsubscribe and uncheck all checkboxes

I would greatly appreciate some help to have a checkbox that when clicked unchecks all other checkboxes.

Has anyone had success with this using Marketo forms 2?

I've tried adding a form object to my landing page and also tried pulling the form in using the embed form code in an html object. I can't even show an alert with the value of a checkbox, so I'm doing something wrong for sure.

Here is the code in the html object.

<script src="//app-abj.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_1211"></form>
<script>MktoForms2.loadForm("//app-abj.marketo.com", "895-WNT-152", 1211);</script>

<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
    // use no conflict mode for jQuery
  var $jQ = jQuery.noConflict();

  function unsubscribeAll () {
    $jQ('#form [type="checkbox"]').each(function () {
        $jQ('#form').append('<input name="' + $jQ(this).attr('name') +'" value="0" type="hidden" />');
    }).removeAttr('checked');

}
$jQ('#button-unsubscribe').click(function () {
        unsubscribeAll();
    });
</script>
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Click unsubscribe and uncheck all checkboxes

Ryan Vong is a great resource for this type of stuff. Super technical.
Josh_Hill13
Level 10 - Champion Alumni

Re: Click unsubscribe and uncheck all checkboxes

We have a developer who can help. Reach out to success@perkuto.com.

Do you have other javascript on your site?