Can I show options on email preferences form based on boolean fields?

Guitarrista82
Level 6

Re: Can I show options on email preferences form based on boolean fields?

Thank you Michael! It was actually a caching issue.

 

Appreciate your input!

 

LK

SanfordWhiteman
Level 10 - Community Moderator

Re: Can I show options on email preferences form based on boolean fields?


Thank you Michael! It was actually a caching issue.

A cookie issue perhaps. Caching shouldn’t matter here, that would be very bad.

Michael_Florin
Level 10

Re: Can I show options on email preferences form based on boolean fields?

Cookie conflicts that interfere with the pre-fill function are very common. Opening your email links in an incognito window or clearing your cache are always good ideas. 🙂



Regarding the JS: It needs to go on the page, usually just above to the closing </body>-tag. JS can't be put on forms AFAIK. That custom area only holds CSS.

 

We use a script like this e.g.

    <script>
setTimeout(() => {
  const check = [
    document.getElementById("checkbox1"),
    document.getElementById("checkbox2"),
  ];
  document
    .getElementById("Unsubscribed")
    .addEventListener("change", (ele) => {
      if (ele.target.value === "true" || ele.target.value === "1") {
        check.forEach((ele) => {
          ele.checked = false;
        });
      }
    });
}, 1000);
    </script>

 

All subsequent data value changes should rather go into a Smart Campaign IMHO. The script only handles the customer facing checkbox behavior.