How can we help?

Opt-in checkboxes

PROBLEM:

I need the Opt-In Checkbox to be check by default

SOLUTION:

1. Click on top right Name or Account name in Web Forms interface

2. Select Custom Javascript

3. Paste the following custom JavaScript in the correct places

*note that this will make the opt-in checkbox selected by default across all lightboxes in the account

===========================

In Before Lightbox Display:

//Auto-check opt-in checkbox
var iframe = document.getElementById(“lightbox - iframe - ” +lbid);
if (iframe !== null) {
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
if (iframeDocument) {
var iframeOptIn = iframeDocument.getElementById(‘form_input_opt_in’);
if (iframeOptIn) {
iframeOptIn.checked = PRIMER_CUSTOM_JS_GLOBAL.precheck_checkbox;
}
}
}

================================
In After Lightbox Display:

//Auto-check opt-in checkbox
var iframe = document.getElementById(“lightbox-iframe-” + lbid);
if (iframe !== null) {
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
if (iframeDocument) {
var iframeOptIn = iframeDocument.getElementById(‘form_input_opt_in’);
if (iframeOptIn) {
iframeOptIn.checked = PRIMER_CUSTOM_JS_GLOBAL.precheck_checkbox;
}
}
}

Comments

0 comments

Please sign in to leave a comment.