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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <form id="registerForm" method="get" action="">
	<fieldset class="step-1">
		<h4>Step One:</h4>
		<span class="clock">Register under one minute!</span>
    <label for="email-register" class="label">E-mail*</label>
		<input id="email-register" name="email-register" type="email" value="" autocomplete="off"/>
		
		<label for="password-register" class="label">Password*</label>
		<input id="password-register" name="password-register" type="password" value="" autocomplete="off"/>
		
		<div class="g-recaptcha" data-sitekey="6LeS4O8SAAAAALWqAVWnlcB6TDeIjDDAqoWuoyo9" data-callback="recaptchaCallback" data-expired-callback="recaptchaExpired" style="margin-top: 3rem;"></div>
		<input id="hidden-grecaptcha" name="hidden-grecaptcha" type="text" style="opacity: 0; position: absolute; top: 0; left: 0; height: 1px; width: 1px;"/>
		</div>
	</fieldset>
	<fieldset class="step-2">
		<h4>Step two:</h4>
		<span class="notice">All fields with a sign are required!</span>
    <label for="first-name" class="label">First Name*</label>
    <input name="first-name" id="first-name" type="text" value="" />
    
    <label for="last-name" class="label">Last Name*</label>
    <input name="last-name" id="last-name" type="text" value="" />
    
    <label for="address" class="label">Address*</label>	
    <input name="address" id="address" type="text" value=""/>
		
    <label for="entrance" class="label">Entrance</label>	
    <input name="entrance" id="entrance" type="text" value=""/>
		
		<label for="apartment-number" class="label">Apartment #</label>
    <input name="apartment-number" id="apartment-number" type="text" value="" />
    
    <label for="inter-phone" class="label">Interphone</label>			
    <input name="inter-phone" id="inter-phone" type="text" value=""/>
    
    <label for="telephone" class="label">Mobile Number*</label>
		<input name="telephone" id="telephone" type="text" value="" />
		
    <label for="special-instructions" class="label">Special Instructions</label>	
    <textarea name="special-instructions" id="special-instructions"></textarea>
		<div>
	</fieldset>
	<button class="button-register" disabled>Register</button>
</form>
              
            
!

CSS

              
                fieldset {
  display: flex;
  flex-direction: column;
   align-items: flex-start; /*so the items are auto width */
}
label.error { color: red; }
              
            
!

JS

              
                function debounce(func, wait, immediate) {
	var timeout;
	return function() {
		var context = this, args = arguments;
		var later = function() {
			timeout = null;
			if (!immediate) func.apply(context, args);
		};
		var callNow = immediate && !timeout;
		clearTimeout(timeout);
		timeout = setTimeout(later, wait);
		if (callNow) func.apply(context, args);
	};
};
function recaptchaCallback() {
	var response = grecaptcha.getResponse(),
		$button = jQuery(".button-register");
	jQuery("#hidden-grecaptcha").val(response);
	console.log(jQuery("#registerForm").valid());
	if (jQuery("#registerForm").valid()) {
		$button.attr("disabled", false);
	}
	else {
		$button.attr("disabled", "disabled");
	}
}
function recaptchaExpired() {
	var $button = jQuery(".button-register");
	jQuery("#hidden-grecaptcha").val("");
	var $button = jQuery(".button-register");
	if (jQuery("#registerForm").valid()) {
		$button.attr("disabled", false);
	}
	else {
		$button.attr("disabled", "disabled");
	}
}
function submitRegister() {
  //ajax stuff
}
(function ($, root, undefined) {
	$(function () {
		'use strict';
        jQuery("#registerForm").find("input").on("keyup", debounce(function() {
          var $button = jQuery(".button-register");
          console.log(jQuery("#registerForm").valid());
          if (jQuery("#registerForm").valid()) {
            $button.attr("disabled", false);
          }
          else {
            $button.attr("disabled", "disabled");
          }
        }, 1000));
        jQuery("#registerForm").validate({
          rules: {
            "email-register": {
              required: true,
              email: true
            },
            "password-register": {
              required: true,
              minlength: "6"
            },
            "first-name": "required",
            "last-name": "required",
            address: "required",
            telephone: "required",
            "hidden-grecaptcha": {
              required: true,
              minlength: "255"
            }
          },
          messages: {
            "email-register": "Enter valid e-mail address",
            "password-register": {
              required: "Enter valid password",
              minlength: "Password must be bigger then 6 chars!"
            },
            "first-name": "Required!",
            "last-name": "Required!",
            address: "Required!",
            telephone: "Required!"
          },
          submitHandler: submitRegister
        });
    });	
})(jQuery, this);
              
            
!
999px

Console