Skip navigation

Do It

2 Posts authored by: Anthony Best

As you may well know currently cannot pre-populate check boxes (or single select fields for that matter) using field merge's on Eloqua forms in E10.


However I have pieced together a sample script which will use a web data lookup to populate these fields.  This example in specific is used to populate subscription preferences.  I will be using this sample as a main component in my class at EE12 this year, but I wanted to share it here first and see if I can get some discussion going or some feedback.  I will be going through this specific example in much more detail at EE12.  And yes.. this is also shameless promotion.


This JS code goes on the Eloqua landing page that this form lives on.  Each "field#" is dynamicly assigned by the Eloqua form, so make sure your fields are set and order is set before putting this type of script on your page.  I have left the look up id's in the sample just so you can see what this would look like.  I have also left comment lines in so you could easily see how to add additional lines in.


Also this form looks to see if an email address has been merged into the form, and if it has not you are redirected to a different form so you can enter it in and set the Eloqua cookie.


Feel free to ask questions, but this script is really just intended to be a code example.


Here is the sample:


<script type="text/javascript">

    var _elqQ = _elqQ || [];

    _elqQ.push(['elqSetSiteId', 'SITE ID HERE']);



    (function() {

        function async_load() {

            var s = document.createElement('script');

            s.type = 'text/javascript';

            s.async = true;

            s.src = '//';

            var x = document.getElementsByTagName('script')[0];

            x.parentNode.insertBefore(s, x);



        if (window.addEventListener)

            window.addEventListener('DOMContentLoaded', async_load, false);

        else if (window.attachEvent)

            window.attachEvent('onload', async_load);



<script type="text/javascript">

    var SubLookupRunning = true;

    var g1 = '{23849e08-8f50-45b4-8de4-e0ee3c5016f0}';

    var g2 = '{185a974b-99a8-4cb0-a526-80e28afdd2b4}';

    var g3 = '{43ad1ef2-7650-4436-bb8c-c412eba32b4a}';

    var g4 = '{da6628c9-d170-4eec-8cbb-7c5f52e83b80}';


    //var g5 = '{4949f39f-ca1b-4621-831c-2750402f3a6b}';


var g1Status;

    var g2Status;

    var g3Status;

    var g4Status;

    //var g5Status;


    function SetElqContent() {

        g1Status = GetElqGroupMembershipStatus(g1);

        g2Status = GetElqGroupMembershipStatus(g2);

        g3Status = GetElqGroupMembershipStatus(g3);

        g4Status = GetElqGroupMembershipStatus(g4);

    //    g5Status = GetElqGroupMembershipStatus(g5);





    function GetEmailAddress() {

        _elqQ.push(['elqDataLookup', escape('6a948629-09c5-452e-a258-92b96bbf7849'), '<C_EmailAddress>' + document.getElementById('field0').value + '</C_EmailAddress>']);



    function SetupForm() {


        radioButtons = document.getElementsByName("radioButtons");

        if (g1Status) {

            document.getElementById('field6').checked = true;

            radioButtons[1].checked = true;




        if (g2Status) {

            document.getElementById('field7').checked = true;

            radioButtons[1].checked = true;



        if (g3Status) {

            document.getElementById('field8').checked = true;

            radioButtons[1].checked = true;



        if (g4Status) {

            document.getElementById('field9').checked = true;

            radioButtons[1].checked = true;



    //    if (g5Status) {

    //        document.getElementById('field5').checked = true;

    //        radioButtons[1].checked = true;

    //    }




    window.onload = GetEmailAddress;

</script><script type="text/javascript" src=""></script><script src=""></script>

<script type="text/javascript">

    $(document).ready(function() {


        if ($("#field0").val() == "") {

            alert("In order to manage your subscriptions, we need to verify your email address by sending you a confirmation email with a link to the Subscription Center.");

            window.location = "URL TO BASIC EMAIL ADDRESS ONLY FORM";



        $("#field10").click(function(event) {

            $("#field6").attr('checked', false);

            $("#field7").attr('checked', false);

            $("#field8").attr('checked', false);

            $("#field9").attr('checked', false);

        //    $("#field5").attr('checked', false);



        $("#field6").change(function() {

            $('[name="radioButtons"][value="No"]').attr('checked', true);



        $("#field7").click(function() {

            $('[name="radioButtons"][value="No"]').attr('checked', true);



        $("#field8").click(function() {

            $('[name="radioButtons"][value="No"]').attr('checked', true);



        $("#field9").click(function() {

            $('[name="radioButtons"][value="No"]').attr('checked', true);



    //    $("#field5").click(function() {

    //        $('[name="radioButtons"][value="No"]').attr('checked', true);

    //    });




This article is intended as a basic frame work for how you can create a double opt in process in Eloqua.  This does not tie in to the default subscription management page, but can tie in to any custom subscription page or into a global opt in or opt out process.


Feel free to post any questions and I am happy to address them.



How to Setup Double Opt-in in Eloqua10


Double Opt-in or Confirmation Opt-In (COI) for our purposes involves having the contact in your database confirm that they indeed want to receive email communication from you. This is mostly used for B2C but this is something to consider if you’re targeting the EMEA region or are concerned with certain anti-spam laws.

This document will take you through creating the forms and emails needed to ensure that your contacts have a double opt-in. You’ll first create a general form that will be used to send an email asking for an opt-in confirmation and then you’ll learn how to include this process in your other forms. We also include some possible email text you can use.

The process flow is as such.

  1. 1) Contact will fill out a basic subscription form
  2. 2) Contact will receive and email from Eloqua asking them to confirm their subscription
  3. 3) Contact will then be added to your database, but then marked as unsubscribed thus leaving them in an opted out stage
  4. 4) If  the contact confirms the subscription, by clicking on the link in the confirmation email, they will be subscribed globally to your communications

Here are the steps for configuring this workflow.

1. Build Opt In Confirmation Email

Email should contain some text similar to the message below:

The “click here” action should have one of three options.


2. Create New Confirmation Page

A new customized confirmation page, contain text informing the contact that they will need to confirm their subscription, should be built which will look similar to the page below.  Store the page in the Confirmation Pages Microsite.  Creating a copy of the default form submit confirmation page is a good place to start.

Recommended Text:

Your information has been submitted successfully!

Thank you for your interest.  You will receive an email momentarily to confirm your information.

You will now be transferred to <Company Name> home page. If you are not redirected within 15 seconds please click here.


3. Create Email Sign-Up Form

If you have chosen option (a) or (c) from step 1 you will only need one form to process the initial subscription request.  For option (b) you will need to create a second form which will contain the contact’s email address.

Create a new form with the data you would like to collect from a new subscriber to your email list.  Be sure to collect any data (and make the field required) you wish to use in personalization for the Opt In Confirmation Email.


4. Add Form Processing Steps

Add form processing steps to the initial subscription form do the following items:

  • Update Contacts – With Form Data
  • Send Submitter an Email (select email created in step 1)
  • Unsubscribe Contacts Globally
  • Redirect to Web Page – Select page created in step 2.


These 3 steps will add the contact to your database, send them an email to confirm their subscription, and set the contact to unsubscribed.  This provide you with their information to try resend the confirmation using Program Builder if they do not complete the Opt In process.


(Option B only) Create Form to accept blind for submit.

Create a basic eloqua form which only contains email address. Field should be hidden. The form processing steps for this for would include the following form processing steps. 

  • Subscribe Contacts Globally  
  • Redirect to Website – Default Subscription confirmation Page



5. Create Landing Pages for Form(s)

Create a landing page to host your newly created Eloqua subscription form, and if option (b) was selected create a second page with your form for the blind submit discussed in step 5.  An alternative to this would be creating or integrating form on your current website.


6. Test

Now that you have configured your assets its important to test your workflow.   I recommend testing this with an email address that does NOT exist in Eloqua currently.

  • Fill out your subscription form and ensure you receive the desired email. 
  • Search for the contact record in Eloqua and make sure they show in the database but have a status of unsubscribed.
  • Click the confirmation link in your email. 
  • Reopen the contact record in Eloqua and make sure the contact is now subscribed globally.

Filter Blog

By date: By tag: