Skip to content

Conversation

@lpinca
Copy link
Member

@lpinca lpinca commented Oct 1, 2016

There are some problems with MailChimp signup forms. This is the generated HTML:

<!-- Begin MailChimp Signup Form -->
<p><link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css"></p>
<p><style type="text/css"></p>
<pre><code>#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
   We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</code></pre><p></style></p>
<p><div id="mc_embed_signup"></p>
<p><form action="//nodejs.us14.list-manage.com/subscribe/post?u=c7c2e114a827812354112c23b&amp;id=f5f8d4eddb" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
    <h2>Subscribe to get updates and give input for education initiatives</h2></p>
<p><div class="indicates-required"><span class="asterisk">*</span> indicates required</div></p>
<p><div class="mc-field-group">
    <label for="mce-EMAIL">Email Address  <span class="asterisk">*</span>
</label>
    <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div></p>
<p><div class="mc-field-group">
    <label for="mce-FNAME">First Name </label>
    <input type="text" value="" name="FNAME" class="" id="mce-FNAME">
</div></p>
<p><div class="mc-field-group">
    <label for="mce-LNAME">Last Name </label>
    <input type="text" value="" name="LNAME" class="" id="mce-LNAME">
</div>
    <div id="mce-responses" class="clear">
        <div class="response" id="mce-error-response" style="display:none"></div>
        <div class="response" id="mce-success-response" style="display:none"></div>
    </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_c7c2e114a827812354112c23b_f5f8d4eddb" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div></p>
<p><script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]=&#39;EMAIL&#39;;ftypes[0]=&#39;email&#39;;fnames[1]=&#39;FNAME&#39;;ftypes[1]=&#39;text&#39;;fnames[2]=&#39;LNAME&#39;;ftypes[2]=&#39;text&#39;;}(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup--></p>

As you can see:

  1. The custom CSS are not applied.
  2. There a lot of spurious <p>s.
  3. The inline script throws a SyntaxError as the code is escaped.

This patch is an attempt to fix these issues.

@mikeal
Copy link
Contributor

mikeal commented Oct 3, 2016

/cc @hackygolucky

@lpinca
Copy link
Member Author

lpinca commented Oct 23, 2016

@nodejs/website can this be looked at? I don't like to have broken scripts.

screen shot 2016-10-23 at 10 49 26

@pin3da
Copy link
Contributor

pin3da commented Dec 7, 2016

@lpinca LGTM

I upload two images to show the diff in the css

before

before

after

after

@lpinca
Copy link
Member Author

lpinca commented Dec 8, 2016

@pin3da Thanks!

@ryanmurakami
Copy link
Contributor

@lpinca LGTM

@ryanmurakami ryanmurakami merged commit 1d7fcf0 into master Dec 8, 2016
@lpinca lpinca deleted the add/mailchimp-form-partial branch December 8, 2016 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants