Formatting Return Message from Singup Form added to WordPress Site (1 post)

  1. mpierce84
    Posted 2 years ago #

    Hello all,

    So, we added a new opt in form to our website. This way visitors to our site can opt in and ask for more information about our service. The form was from Contactology, an ESP program. You can find the form code below my question.

    The form is a mix of html and javascript. When someone submits their information, successfully or unsuccessfully, the form returns a message that say's thanks or check your information.

    My question is, does anyone know how to format the return message? I attempted to add formatting to the span tag that message returns in but that did nothing.

    Also, I tried placing the span tag in a div tag but again it didn't format correctly. Anyone have any ideas?

    The live form can be found at http://www.buildinghunter.com/ while the code from Contactology out of the box can be found below.

    <form id="IBNSubscribeForm" accept-charset="UTF-8" action="">
       Email:<input id="IBNSubscribeEmail" type="text" name="email">
       <input id="IBNSubscribeButton" type="submit" value="Subscribe">
       <span id="IBNStatusMessage"></span>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript">
    function isValidEmailAddress(emailAddress) {
       var pattern = /^([a-zA-Z0-9])(([a-zA-Z0-9])*([._+-])*([a-zA-Z0-9]))*@(([a-zA-Z0-9-])+(.))+([a-zA-Z]{2,4})+$/;
       return pattern.test(emailAddress);
    (function($) {
    $.fn.EmailCampaignsSubscribe = function(client_id, lists, opt){
       var defaults = {
           form: "IBNSubscribeForm",
           email: "IBNSubscribeEmail",
           msg: "IBNStatusMessage",
           button: "IBNSubscribeButton",
           successMsg: "Thanks for signing up!",
           emailValidation: true,
           submitForm: false,
           errorMsg: "Oops...check your email address"
       var subscribeFunction = function(){
           var valid = true;
           if(opt.emailValidation && !isValidEmailAddress($("#"+opt.email).val())){
               valid = false;
           if(valid) {
               var data = $("#"+opt.form).serialize();
               var img = "";
               for (i in lists) {
                    img += "<img style='display:none;' src='http://server1.emailcampaigns.net/autoadd/?c="+client_id+"&"+data+"&lid="+lists[i]+"'>";
               $("#"+opt.form).html(opt.successMsg + img);
           } else{
       var opt = $.extend(defaults, opt);
       $("#"+opt.button).click( subscribeFunction );
       $("#"+opt.form).submit( function(e) {
           if ( ! opt.submitForm ) {
    <script type="text/javascript">jQuery.fn.EmailCampaignsSubscribe("####",[#]);</script>

Topic Closed

This topic has been closed to new replies.

About this Topic