Need help? Check out our Support site, then


html code that does not work on my blog

  1. Hello guys.
    I need your help because I have the feeling that I am losing my time.
    I am trying to put an external subscription form on my blog but it does not work. I know that I have to use the Text widget but the problem is that my html code consists of elements that are forbidden by WordPress.
    What can I do? I want to finish with that task finally.
    Thank you!

    Here is the HTML code:

    <form action="https://madmimi.com/signups/subscribe/94353" id="mad_mimi_signup_form" method="post" target="_blank">
    <div class="required">
    <label for="signup_email">Email</label>

    <input class="required" data-invalid-email="This field is invalid" data-required-field="This field is required" id="signup_email" name="signup[email]" placeholder="[email redacted]" type="text"/>
    </div>
    <div class="required">
    <label for="signup_first_name">First Name</label>

    <input class="required" data-required-field="This field is required" id="signup_first_name" name="signup[first_name]" type="text"/>
    </div>
    <div>
    <input class="submit" data-choose-list="↑ Choose a list" data-default-text="Subscribe" data-invalid-text="↑ You forgot some required fields" data-submitting-text="Sending..." id="webform_submit_button" name="commit" type="submit" value="Subscribe"/>
    </div>
    </form>
    <script type="text/javascript">
    (function() {
    var form = document.getElementById("mad_mimi_signup_form"),
    submit = document.getElementById("webform_submit_button"),
    validEmail = /.+@.+\..+/,
    isValid;

    form.onsubmit = function(event) {
    validate();
    if(!isValid) {
    revalidateOnChange();
    return false;
    }
    };

    function validate() {
    isValid = true;
    emailValidation();
    fieldsValidation();
    listsValidation();
    updateFormAfterValidation();
    }

    function emailValidation() {
    var email = document.getElementById("signup_email");
    if(!validEmail.test(email.value)) {
    errorMessage(email);
    isValid = false;
    } else {
    removeErrorMessage(email);
    }
    }

    function fieldsValidation() {
    for(var i = 0; i < form.elements.length; ++i) {
    var input = form.elements[i];
    if(input.id == "signup_email") continue;
    if(input.className.indexOf("required") >= 0) {
    if(input.value == "") {
    errorMessage(input)
    isValid = false;
    } else {
    removeErrorMessage(input);
    }
    }
    }
    }

    function listsValidation() {
    var mainListsDiv = document.getElementById("signup_audience_lists");
    if(mainListsDiv && mainListsDiv.className.indexOf("required") >= 0) {
    var listSelected = false;
    for(var i = 0; i < form.elements.length; ++i) {
    var input = form.elements[i];
    if(input.type != "checkbox") continue;
    if(input.checked) listSelected = true;
    }
    if(!listSelected) {
    if(mainListsDiv.className.indexOf("invalid") == -1) mainListsDiv.className += " invalid";
    isValid = false;
    } else {
    mainListsDiv.className = mainListsDiv.className.replace(/ invalid/g, "");
    }
    }
    }

    function errorMessage(input) {
    input.className = "required invalid";
    input.placeholder = input.getAttribute("data-required-field");
    }

    function removeErrorMessage(input) {
    input.className = "required";
    input.placeholder = "";
    }

    function updateFormAfterValidation() {
    form.className = isValid ? "" : "mimi_invalid";
    submit.value = submitButtonText();
    submit.disabled = !isValid;
    submit.className = isValid ? "submit" : "disabled";
    }

    function submitButtonText() {
    var text;
    if(isValid) {
    text = submit.getAttribute("data-default-text");
    } else {
    var allFieldsValid = checkIfAllFieldsAreValid();
    if(allFieldsValid) {
    text = submit.getAttribute("data-choose-list");
    } else {
    text = submit.getAttribute("data-invalid-text");
    }
    }
    return text;
    }

    function checkIfAllFieldsAreValid() {
    var allFieldsValid = true
    for(var i = 0; i < form.elements.length; ++i) {
    var input = form.elements[i];
    if(input.placeholder && input.placeholder.length > 0) allFieldsValid = false;
    }
    return allFieldsValid;
    }

    function revalidateOnChange() {
    for(var i = 0; i < form.elements.length; ++i) {
    var input = form.elements[i];
    if(input.className.indexOf("required") >= 0 || input.type == "checkbox") {
    input.onchange = validate;
    }
    }
    }
    })();
    </script>

    The blog I need help with is preciouscopywriting.wordpress.com.

  2. You are posting codes that we cannot use on free hosted blogs for security reasons. Please read these sections of the support doc closely.
    http://en.support.wordpress.com/code/#html-tags
    http://en.support.wordpress.com/code/#javascript

  3. There is no upgrade you can purchase that changes the code restrictions. So if you want to set up an Aweber, Constant Contact, FeedBlitz or GetResponse email list for high powered email marketing campaigns then you will need to hire a web host and set up your own WordPress.org install.

    To use MailChimp with your WordPress.com site you can create a link to the signup form you create at MailChimp.

    You can set up email subscriptions here > Appearance > Widgets > Follow Blog Widgets by using this guide > http://en.support.wordpress.com/widgets/follow-blog-widget/

    If you would like a follow button to appear on the bottom right hand corner of your site for those who do not have WordPress.com accounts go to > Settings > Reading and scroll down to Follower Settings:

    These settings change emails sent from your blog to followers.
    Logged out users __ Show follow button to logged out users.

    Checking this will present a follow button to logged out users in the bottom corner of their screen.

    Find Friends Who Use WordPress > http://en.blog.wordpress.com/2012/05/01/find-friends/

    You can customize the contact form with multiple fields, change the email address where you'll be notified, and mark feedbacks as spam from your dashboard. http://en.support.wordpress.com/contact-form/

  4. Thank you!
    That helps a lot!

  5. You're welcome and best wishes with your blog.

Topic Closed

This topic has been closed to new replies.

About this Topic