Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <ul id="progressbar">
		    <li id="one">1</li>
		    <li id="bar1"></li>
		    <li id="two">2</li>
		    <li id="bar2"></li>
		    <li id="three">3</li>
	    </ul>

        <form action="#" method="GET" target="_self">
		    <div id="form_1">
		    
		    	<h1>create your account</h1>
		    	<input id="email" type="text" placeholder="email input">
		    	<input id="password" type="text" placeholder="password input">
		    	<input id="confirmedPassword" type="text" placeholder="confirm password input">
		    	<button id="formButton1" type="button">NEXT</button>
		    
		    </div>



		    <div id="form_2">
		    
		    	<h1>add your personal info</h1>
		    	<input id="firstName" type="text" placeholder="first name input">
		    	<input id="lastName" type="text" placeholder="last name input">
		    	<input id="phoneNumber" type="text" placeholder="phone number input">
		    	<input id="address" type="text" placeholder="street address input">
		    	<button id="formButton2" type="button">previous</button>
		    	<button id="formButton3" type="button">NEXT</button>
		    
            </div>



            <div id="form_3">
		    
		    	<input id="username" type="text" placeholder="username input">
		    	<input id="bio" type="textarea" placeholder="bio input">
		    	<input id="agreeTerms" type="checkbox" name="agree" value="agreed?" > 
		    	<label for="agreeTerms">Do you agree to the terms?</label>
		    	<button id="formButton4" type="button">previous</button>
		    	<input id="formButton5" type="submit" value="SUBMIT">
		    
		    </div>
		    </form>
		    <div id="thanks">
		        <h1>Thank you for signing up!</h1>
		    </div>
		    <div id="user_summary_info">
		    	<div id="end"></div>
		    </div>
              
            
!

CSS

              
                * {
		    	box-sizing: border-box;
		    	margin: 0;
		    	padding: 0;
		    }

			h1 {
				text-transform: uppercase; 
				font-size: 20px;
				margin:20px;
			}

			input {
				display: block;
				width: 13rem;
				height: 50px;
				margin: auto;
				margin-bottom: 15px;
				border: 2px solid black;
			}

			input::-webkit-input-placeholder {
                 font-size: 15px;
            }

            button {
            	border: 2px solid black;
            	width: 125px;
            	height: 50px;
            	margin-bottom: 25px;
            	background-color: white;
            	text-transform: uppercase;
            }

            label {
                margin-right: 20px;
            }
            

			#form_1, #form_2, #form_3, #user_summary_info, #thanks {
                width: 400px;
                border: 2px solid black;
                margin: 50px auto;
                text-align: center;
			}

		    #fix {
				display: inline;
				border: 1px solid black;
			}

			#agreeTerms {
				width: 20px;
				margin: 0px 0px 20px 65px;
				height: 20px;
				display: inline-block;
			}

			#username {
				margin-top: 40px;
			}

			#bio {
				height: 75px;
			}

			#formButton5 {
				border: 2px solid black;
            	width: 125px;
            	height: 50px;
            	margin-bottom: 25px;
            	background-color: white;
            	text-transform: uppercase;
            	display: inline;

            }
            #user-summary-info {
            	text-align: left;
            	padding: 30px;
            }

            #end ul {
            	list-style-type: none;
            	text-align: left;
            }

            #end ul li {
            	margin: 10px;

            }

            #progressbar {
            	list-style-type: none;
            	margin: 40px auto;
            	margin-bottom: -20px;
            	padding: 0;
            	width: 400px;
            	
            }

            #one, #two, #three {
            	display: inline-block;
            	border: 1px solid black;
            	height: 40px;
            	width: 40px;
            	border-radius: 50%;
            	text-align: center;
            	padding-top: 10px;
            	margin: 0px;

            }

            #bar1, #bar2 {
            	display: inline-block;
            	border: 1px solid black;
            	background-color: green;
            	height: 5px;
            	width: 131px;
 
            }

            #thanks {
            	margin-bottom: -20px;
            	border: none;

            }
              
            
!

JS

              
                $(document).ready(function (){
            	$("#form_2, #form_3, #user_summary_info").hide();
            	$("#thanks").hide();
            	$("#one").css({
            		"background-color":"black",
            		"color":"white"
            	});
            	$("#two, #bar1, #bar2, #three").css({
            		"background-color": "white"
            		});
                //validating form 1
                var validate1 = function(){
                	var userEmail = $("#email");
            	    var emailValue = userEmail.val();
            	    var userPassword = $("#password");
            	    var passwordValue = userPassword.val();
            	    var userConfirm = $("#confirmedPassword");
            	    var confirmValue = userConfirm.val();
            	    var validMail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; 
            	    if(emailValue.match(validMail) === null){
            	    	alert("Please enter valid email address.");
            	    	return false;
            	    }else if(passwordValue.match(confirmValue) === null){
            	    	alert("Please enter matching passwords.");
            	    	return false;
            	    }else{
            	    	sessionStorage.setItem('email', emailValue);
            	    	sessionStorage.setItem('password', passwordValue);
            	    	$("#form_1").hide();
            	    	$("#form_2").show();
            	    	$("#bar1, #two").css({
            	    		"background-color":"black",
            	    		"color":"white"
            	    	});
            	    }
                };
           		$("#formButton1").on("click", validate1);

           		//for previous button on form 2
           		$("#formButton2").on("click",function(){
           			$("#form_2").hide();
           			$("#form_1").fadeIn(100);
           	    	$("#bar1, #two").css({
            	    	"background-color":"white",
            	    	"color":"black"
            	    	});           			
           		});

           		//validating form 2
           		var validate2 = ()=>{
           			var fname = $("#firstName");
           			var fnameValue = fname.val();
           			var lname = $("#lastName"); 
           			var lnameValue = lname.val();
           			var num = $("#phoneNumber");
           			var numValue = num.val();
           			var validNumber = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
           			var userAddress = $("#address");
           			var userAddressValue = userAddress.val();
           			if(fnameValue === ""){
           				alert("Please enter first name.");
           				return false;
           			}else if(lnameValue === ""){
           				alert("Please enter last name");
           				return false;
           			}else if(numValue.match(validNumber) === null){
           				alert("Please enter valid number in xxx-xxx-xxx format");
           				return false;
           			}else if (userAddressValue === ""){
           				alert("Please enter street address.");
           				return false;
           			}else{
           				sessionStorage.setItem('firstname', fnameValue);
           				sessionStorage.setItem('lastname', lnameValue);
           				sessionStorage.setItem('phonenumber', numValue);
           				sessionStorage.setItem('address', userAddressValue);
           				$("#form_2").hide();
           				$("#form_3").show();
           	    	    $("#bar2, #three").css({
            	    	    "background-color":"black",
            	    		"color":"white"
            	    	});           				
           			}
           		};
           		$("#formButton3").on("click", validate2);

           		//for previous button on form 3
           		$("#formButton4").on("click",()=>{
           			$("#form_3").hide()
           			$("#form_2").fadeIn(100);
           	    	$("#bar2, #three").css({
            	    	"background-color":"white",
            	    	"color":"black"
            	    	});           			
           		});

           		//validating form 3
           		var validate3 = (e)=>{
           		    var uname = $("#username");
           		    var unameValue = uname.val();
           		    var uBio = $("#bio");
           		    var uBioValue = uBio.val();
           		    var terms = $("#agreeTerms");
           		    console.log(terms);
           		    if(unameValue === ""){
           			    alert("Please enetr a username.");
           			    return false;
           		    }else if(uBioValue === ""){
           			    alert("Enter bio.");
           			    return false;
           		    }else if(terms.prop('checked') === false){
           		    	alert("Please check that you agree to the terms of service.")
           			    return false;    
           		    }else{
           		    	$("#form_3").hide();
           		    	$("#form_1, #form_2").hide();
           		    	sessionStorage.setItem('username', unameValue);
           		    	sessionStorage.setItem('bio', uBioValue);
           		    	var identity = sessionStorage.getItem("username");
           	            var fullname = sessionStorage.getItem("firstname")+" "+sessionStorage.getItem("lastname");
           	            var email = sessionStorage.getItem("email");
           	            var phone = sessionStorage.getItem("phonenumber");
           	            var address = sessionStorage.getItem("address");
           	            var biography = sessionStorage.getItem("bio");
           	            var sum = {summ:[identity, fullname, email, phone, address, biography]};
           	            localStorage.setItem('results', JSON.stringify(sum));
           	            console.log(identity + fullname);
           	            console.log(typeof(identity));
           	            $("#end").append(
           	    	        "<ul><li>"+identity+"</li><li>"+fullname+"</li><li>"+email+"</li><li>"+phone+
           	    	        "</li><li>"+address+"</li><li>"+biography+"</li></ul>"
           	    	        );
           	            $("#thanks").show();
           		    	$("#user_summary_info").show();   
           		    	$("#one, #bar1, #two, #bar2, #three").hide(); 	
                    e.preventDefault();	    	
           		    };

           	    };
           	    $("#formButton5").on("click", validate3);


            });
              
            
!
999px

Console