Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                  <div id="EmmaForm">

    <div class="ui column grid">

      <div class="form column">

        <div id="e2ma_signup_form_container" class="e2ma_signup_form_container">

        <form class="ui form" id="e2ma_signup" method="post">

        <div class="field">
          <div class="ui left labeled icon input">
            <input id="id_email" type="text" name="email" />
            <div class="ui corner label"> <i class="icon asterisk"></i></div>

               <!-- GroupID the submit the data -->
               <input id="groups" type="hidden" value="123456" name="groups" class="number">

        <button id="EmmaSubmit" class="olive ui labeled icon button" type="submit"><i class="mail sqaure icon"></i>Submit</button>
        <div class="ui error message"></div>




<!-- end form DIV -->


                .ui.grid {


                $(document).ready(function() {
        //Sets form validation
            inline: true,
            fields: {
                email: {
                    identifier: "id_email",
                    rules: [{
                        type: "email"
            //submits form if it passes validation
            onSuccess: function() {

                $form = $(this);
                $_form = $(this).find('form');
                var email = $("#id_email").val();
                var groups = $('#groups').val();
                var data = "{\"email\": \"" + email + "\",\"optInConfirmation\": true,\"accountId\": \"1234567\",\"groups\": [" + groups + "]}";

                //the Emma lighbox API doesn't return the expected JSON response, so the "success" function handles the text response
                        type: "POST",
                        cache: false,
                        url: '',
                        data: data,
                        contentType: 'application/json',
                        dataType: 'text',
                        success: function(text) {
                            var json = text ? $.parseJSON(text) : null;
                    //triggered if successfully submitted. Can add additional functions here
                    .done(function(data) {
                        $('form.ui').replaceWith("<div class=\"ui positive message\"><div class=\"header\">Thanks for joining our list!</div><p>We'll be in touch soon.</p></div>");
                    .fail(function(jqXHR, textStatus) {
                        $form.form('add errors', ['Error']);

                return false;