Landing Page - Embed Form
I created a standard web form with my subscription group. I enabled the "include select all" option on the form object. I chose the iframe option when embedding. The form is displaying fine except that it is not displaying the "select all" checkbox on my subscription group.
When I choose the external post embed code, it is displaying the "select all" checkbox and works perfectly.
Is there any reason why the select all checkbox is not displaying when you choose the iframe option for embedding your form?
-
Hey Ryan,
I just noticed that I incorrectly described the issue I am having. The select all checkbox is showing up on an Iframe but not on external post embed code.
Yes, the select all checkbox shows up on my landing page when accessed directly.
I've staged the different forms on a test page. You can see the behavior happening here.
Thanks!
-
Hey Don,
Thanks for providing the URL of what you are experiencing.
The external form post code doesn't include the select all because it takes a bit of JavaScript to make this happen. If you're interested in using the external form post code on the site instead of an iframe, please see the sample code below:
Add the following script to the head section of the page:<script>
function toggleAllCheckboxes(element){
var groupName = element.getAttribute("name");
var checkboxes = document.getElementsByName(groupName);
for(var index=0; index<checkboxes.length; index++){
if(checkboxes[index] == element){
//skip select all block
}else{
if(checkboxes[index].type == "checkbox"){
checkboxes[index].checked = element.checked;
}
}
}
}
</script>Then add this html bock to the External Post Code right before the first checkbox (you can also add this at the bottom, creative choice):
<tr>
<td style="width: 592px">
<div class="checkbox_wrap">
<input class="checkbox" label="Subscription group" name="SUBSCRIPTION_GROUP" type="checkbox" value="Select All" onclick="toggleAllCheckboxes(this);">
<label class="checkbox_label">Select All</label>
</div>
</td>
</tr> -
Hey Don,
I'm glad it's working! Keep in mind that code can be used on all forms you may have with subscription groups. I'm not sure if there is documentation on this specific use case, but I'll pass it along to our technical writers.
Acoustic is always listening to their customers needs, wants, and ideas. I encourage you to check out the ideas portal feel free to submit this as an idea or check out other ideas and vote on your favorites. 70 customer ideas have already been added to Campaign!
Please sign in to leave a comment.
Comments
5 comments