Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div class="bs-callout bs-callout-warning hidden">
  <h4>Oh snap!</h4>
  <p>This form seems to be invalid :(</p>

<div class="bs-callout bs-callout-info hidden">
  <p>Everything seems to be ok :)</p>

<form id="demo-form" data-parsley-validate="">
  <label for="fullname">Full Name * :</label>
  <input class="form-control" name="fullname" required="" type="text">

  <label for="email">Email * :</label>
  <input class="form-control" name="email" data-parsley-trigger="change" required="" type="email">

  <label for="gender">Gender *:</label>
    M: <input name="gender" id="genderM" value="M" required="" type="radio">
    F: <input name="gender" id="genderF" value="F" type="radio">

  <label for="hobbies">Hobbies (Optional, but 2 minimum):</label>
    Skiing <input name="hobbies[]" id="hobby1" value="ski" data-parsley-mincheck="2" type="checkbox"><br>
    Running <input name="hobbies[]" id="hobby2" value="run" type="checkbox"><br>
    Eating <input name="hobbies[]" id="hobby3" value="eat" type="checkbox"><br>
    Sleeping <input name="hobbies[]" id="hobby4" value="sleep" type="checkbox"><br>
    Reading <input name="hobbies[]" id="hobby5" value="read" type="checkbox"><br>
    Coding <input name="hobbies[]" id="hobby6" value="code" type="checkbox"><br>

  <label for="heard">Heard about us via *:</label>
  <select id="heard" required="">
    <option value="">Choose..</option>
    <option value="press">Press</option>
    <option value="net">Internet</option>
    <option value="mouth">Word of mouth</option>
    <option value="other">Other..</option>

  <label for="message">Message (20 chars min, 100 max) :</label>
  <textarea id="message" class="form-control" name="message" data-parsley-trigger="keyup" data-parsley-minlength="20" data-parsley-maxlength="100" data-parsley-minlength-message="Come on! You need to enter at least a 20 character comment.." data-parsley-validation-threshold="10"></textarea>

  <input class="btn btn-default" value="validate" type="submit">

  <p><small>* Please, note that this demo form is not a perfect example of UX-awareness. The aim here is to show a quick overview of parsley-API and Parsley customizable behavior.</small></p>
              h4 {
  margin-bottom: 10px;
p.parsley-success {
  color: #468847;
  background-color: #DFF0D8;
  border: 1px solid #D6E9C6;
p.parsley-error {
  color: #B94A48;
  background-color: #F2DEDE;
  border: 1px solid #EED3D7;
html.codepen body {
  margin: 1em;

              $(function () {
  $('#demo-form').parsley().on('field:validated', function() {
    var ok = $('.parsley-error').length === 0;
    $('.bs-callout-info').toggleClass('hidden', !ok);
    $('.bs-callout-warning').toggleClass('hidden', ok);
  .on('form:submit', function() {
    return false; // Don't submit form for this demo
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.