jQuery Scrollable Registration Wizard

. 6/16/10
  • Agregar a Technorati
  • Agregar a Del.icio.us
  • Agregar a DiggIt!
  • Agregar a Yahoo!
  • Agregar a Google
  • Agregar a Meneame
  • Agregar a Furl
  • Agregar a Reddit
  • Agregar a Magnolia
  • Agregar a Blinklist
  • Agregar a Blogmarks

Here is a registration wizard with primitive input validation logic and a "twitter" style message box for validation errors:

jQuery scrollable registration wizard


HTML


<div id="wizard">
 <ul id="status">
  <li class="active"><strong>1.</strong> Create Account</li>
  <li><strong>2.</strong> Contact Information</li>
  <li><strong>3.</strong> Finalize</li>
  </ul>
 <div class="items">
 <!-- page1 -->
  <div class="page">
 <h2>
  <strong>Step 1: </strong> jQuery Tools Account
  <em>Please enter your login information:</em>
  </h2>
 <ul>
  <!-- email -->
  <li class="required">
  <label>
  <strong>1.</strong> Enter Your Email Address <span>*</span><br>
  <input type="text" name="email" class="text">
  <em>Your password will be sent to this address. Your address will not made public.</em>
  </label>
  </li>
 <!-- username -->
  <li>
  <label>
  <strong>2.</strong> Pick a username <br>
  <input type="text" name="username" class="text">
  <em>Your preferred username to be used when logging in.</em>
  </label>
  </li>
 <!-- password -->
  <li class="required double">
 <label>
  <strong>3.</strong> Choose a Password <span>*</span><br>
  <input type="password" name="password" class="text">
  <em>Must be at least 8 characters long.</em>
  </label>
 <label>
  Verify Password <span>*</span><br>
  <input type="password" name="password1" class="text">
  </label>
  </li>
 <li class="clearfix">
  <button class="next right" type="button">Proceed »</button>
  </li>
  </ul>
 </div>
 <!-- page2 -->
  <div class="page">
 <h2>
  <strong>Step 2: </strong> Contact Information <b></b>
  <em>Please tell us where you live:</em>
  </h2>
 <ul>
  <!-- address -->
  <li class="required">
  <label>
  <strong>1.</strong> Enter Your Street Address <span>*</span><br>
  <input type="text" name="email" class="text">
  <em><strong>Example</strong>: Random Street 69 A 666</em>
  </label>
  </li>
 <!-- zip / city -->
  <li class="required double">
 <label>
  <strong>2.</strong> Enter Your Zip Code <span>*</span><br>
  <input name="zip" class="text">
  <em>This must be a numeric value</em>
  </label>
 <label>
  <strong>3.</strong> and The City <span>*</span>
  <select name="city">
  <option value="">-- please select --</option>
  <option>Helsinki</option>
  <option>Berlin</option>
  <option>New York</option>
  </select>
  </label>
  </li>
 <li class="clearfix">
  <button style="float: left;" class="prev disabled" type="button">« Back</button>
  <button class="next right" type="button">Proceed »</button>
  </li>
 <br clear="all">
  </ul>
 </div>
 <!-- page3 -->
  <div class="page">
 <h2>
  <strong>Step 3: </strong> Congratulations! <b></b>
  <em>You are now a happy member of the Open Source community</em>
  </h2>

 
 <p style="margin-top: 30px;">
  <button class="prev disabled" type="button">« Back</button>
  </p>
 </div>

 </div>
 </div>



CSS

/* scrollable root element */
#wizard {	
	background:#fff url(../images/h600.png) repeat scroll 0 0;
	border:5px solid #789;
	font-size:12px;
	height:450px;
	width:570px;
	overflow:hidden;
	position:relative;
	
	/* rounded corners for modern browsers */
	-moz-border-radius:5px;
	-webkit-border-radius:5px;
}  

/* scrollable items */
#wizard .items {
	width:20000em;	
	clear:both;	
	position:absolute;	
}

/* single item */
#wizard .page {	
	padding:20px 30px;
	width:500px;
	float:left;	
}

/* title */
#wizard h2 {
	border-bottom:1px dotted #ccc;
	font-size:22px;
	font-weight:normal;
	margin:10px 0 0 0;
	padding-bottom:15px;		
}

#wizard h2 em {
	display:block;
	font-size:14px;
	color:#666;
	font-style:normal;
	margin-top:5px;
}

/* input fields */
#wizard ul {
	padding:0px !important;
	margin:0px !important;
}

#wizard li {
	list-style-type:none;
	list-style-image:none;
	margin-bottom:25px;	
}

#wizard label {
	font-size:16px;	
	display:block;
}

#wizard label strong {
	color:#789;	
	position:relative;
	top:-1px;
}

#wizard label em {
	font-size:11px;
	color:#666;	
	font-style:normal;
}

#wizard .text {
	width:100%;
	padding:5px;
	border:1px solid #ccc;
	color:#456;
	letter-spacing:1px;
}

#wizard select {
	border:1px solid #ccc;
	width:94%;	
	padding:4px;
}

#wizard label span {
	color:#b8128f;
	font-weight:bold;
	position:relative;
	top:4px;
	font-size:20px;
}

#wizard .double label { 
	width:50%;
	float:left;
}

#wizard .double .text {
	width:93%;	
}

#wizard .clearfix {
	clear:left;
	padding-top:10px;	
}

#wizard .right {
	float:right;		
}

/* validation error message bar */
#drawer {
	background:#fff url(../images/h80.png) repeat-x scroll 0 0;
	_background-color:#fff;
	overflow:visible;
	position:fixed;	
	left:0;
	top:0;
	text-align:center;
	padding:15px;
	font-size:18px;
	border-bottom:2px solid #789;
	width:100%;
	display:none;
	z-index:2;
}

#wizard .error {
	border:1px solid red;		
}

#wizard #status {
	margin:0px !important;
	height:35px;
	background:#123 url(../images/h30.png) repeat-x;
	padding-left:25px !important;
	_background:#123;
}

#status li {
	list-style-type:none;
	list-style-image:none;
	float:left;
	color:#fff;
	padding:10px 30px;
}

#status li.active {
	background-color:#b8128f;
	font-weight:normal;		
}




JavaScript


function formatText(index, panel) {
		  return index + "";
	    }
    
        $(function () {
        
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 3000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "Go",             // Start text
		        stopText: "Stop",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });



jquery.tools.min.js


Click to Download



scrollable-registration-wizard.js


Click to Download




Example


Click to DEMO

1 comments:

Tamil Nambi said...

Hi That was great..I am searching this for 2 days and finally got it in this blog. Thanks a lot. One more help i need please say is it possible.

Eg:- I fill the form in Step #1 and click the next button from the Step #2 page if i click refresh (F5) its taking me to step #1.

Is it possible to make it stay in Step #2? Please help on this