Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Save Automatically?

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.

HTML

              
                <!-- 
  STEP 1
  Include the password control JS somewhere on your page, 
  then add the enz-enable attribute to your password 
  input element.
-->
<script type="text/javascript" 
        src="https://cdn.enzoic.com/js/enzoic.min.js">
</script>

<h4 class="text-center">
  Example Signup Form Using Enzoic
</h4>

<p class="text-center offset-1">
  Highlight the "Choose a Password" field to see the Password Strength Meter in action.
</p>

<form id="signupForm" 
      action="https://cdn.enzoic.com/demosignupsuccess.html" 
      class="offset-4 demo-form pp-container text-center">
  <fieldset>
    
    <!-- email address field -->
    <div class="row">
      <div class="col-md-12">
        <input type="text" placeholder="Your Email Address" />
      </div>
    </div>
    
    <div class="row">
      <!-- password field -->    
      <div class="col-md-6">
        <!-- 
          STEP 2
          To add Enzoic meter to this input, 
          add the enz-enable attribute to the markup.
          Other "enz-" attributes can be used for further 
          customization.
        -->
        <input type="password" 
               name="password" 
               placeholder="Choose a Password" 
               enz-enable 
               enz-theme="default"
               enz-min-password-strength="4" 
               enz-css-success-class="enz-success" 
               enz-css-fail-class="enz-fail" />
      </div>
      
      <!-- confirm password field -->    
      <div class="col-md-6">
        <input type="password" 
               placeholder="Confirm Password" />
      </div>
    </div>
   
    <!-- submit button -->
    <div class="btn-group text-center">
      <button type="submit" 
              class="btn btn-md btn-primary">
        Test Submit
      </button>
      
      <p class="offset-1 small">
        This is an example to show the Password Strength Meter in action.<br />
        You're not signing up for an account.
      </p>
    </div>
    
    <!-- simple toast for validation messaging to user -->
    <div id="resultToast" class="result-toast">
      <span class="loader"></span>
      <span id="resultToastMsg" class="msg">...</span>
    </div>
    
  </fieldset>
</form>
              
            
!

CSS

              
                /* 
   Example usage of the Enzoic CSS classes to show visual 
   indicators for password acceptability.  The enz-success 
   and enz-fail CSS classes get added automatically to 
   the password input control when a password is classified 
   by Enzoic.  See the documentation for more details.
*/

input.enz-fail {
  border-color: #b94a48 !important;
  background: url(https://cdn.enzoic.com/images/warning.png) 
    right 5px center no-repeat;
}

input.enz-success {
  border-color: #32cd32 !important;
}

              
            
!

JS

              
                /* handler for the signup form's onsubmit event */
function onSignupFormSubmit() {
  /*
    Decide what your minimum allowable password 
    score is and disallow if less.  You can check 
    the current score using the CurrentPasswordScore 
    property.
  */
  if (Enzoic.currentPasswordScore < 
      Enzoic.PASSWORD_STRENGTH.Strong) {
    showToast("Entered password is not strong enough.");
    return false;
  }

  return true;
}

function showToast(msg) {
  var toastEl = document.getElementById("resultToast");
  var toastMsg = document.getElementById("resultToastMsg");
  toastMsg.innerHTML = msg;
  toastEl.className += " fail";

  // hide toast
  setTimeout(hideToast, 2000);
}

function hideToast() {
  var toastEl = document.getElementById("resultToast");

  toastEl.className = toastEl.className.replace("fail", "");
}

document.getElementById("signupForm").onsubmit = onSignupFormSubmit;

              
            
!
999px

Console