Multi-step Registration Form Template using HTML, JavaScript, and CSS

Language

This is a Multi-step Registration form Template and design. The source code contains HTML, CSS, and JavaScript files. This template provides a step-by-step feature for filling the fields of the registration form. It can give your end-users a better experience while using your site.

How does the template work?

The registration form template was written in HTML script and has 3 steps. It has an indicator above the form to let the users identify the step that they user is currently filling in. The step navigation was achieved using JavaScript. It has a sliding up and down animation when navigating every step. Slide up animation for user proceeds to the next step and slide down animation when the users navigate to the previous step.

Here's the script of this Multi-step registration form template.

CSS (style.css)

  1. *{
  2. margin: 0;
  3. padding: 0;
  4. font-family: san-serif;
  5. }
  6. body{
  7. background-image: linear-gradient(rgba(0,0,0,0.8),rgba(0,0,0,0.8)),url(banner.jpeg);
  8. background-position: center;
  9. background-size: cover;
  10. }
  11. .container{
  12. width: 360px;
  13. height: 400px;
  14. margin: 8% auto;
  15. background: #fff;
  16. border-radius: 5px;
  17. position: relative;
  18. overflow: hidden;
  19. }
  20. h3{
  21. text-align: center;
  22. margin-bottom: 40px;
  23. color: #777;
  24. }
  25. .container form{
  26. width: 280px;
  27. position: absolute;
  28. top: 100px;
  29. left: 40px;
  30. transition: 0.5s
  31. }
  32. form input{
  33. width: 100%;
  34. padding: 10px 5px;
  35. margin: 5px 0;
  36. border: 0;
  37. border-bottom: 1px solid #999;
  38. outline: none;
  39. background: transparent;
  40. }
  41. ::placeholder{
  42. color: #777;
  43. }
  44. .btn-box{
  45. width: 100%;
  46. margin: 30px auto;
  47. text-align: center;
  48. }
  49. form button{
  50. width: 110px;
  51. height: 35px;
  52. margin: 0 10px;
  53. background: linear-gradient(to right, #008000,#ffad06);
  54. border-radius: 30px;
  55. border: 0;
  56. outline: none;
  57. color: #fff;
  58. cursor: pointer;
  59. }
  60. #step2{
  61. top: 450px;
  62. }
  63. #step3{
  64. top: 450px;
  65. }
  66. .step-row{
  67. width: 360px;
  68. height: 40px;
  69. margin: 0 auto;
  70. display: flex;
  71. align-items: center;
  72. box-shadow: 0 -1px 5px -1px #000;
  73. position: relative;
  74. }
  75. .step-col{
  76. width: 120px;
  77. text-align: center;
  78. color: #333;
  79. position: relative;
  80. }
  81. #progress{
  82. position: absolute;
  83. height: 100%;
  84. width: 120px;
  85. background: linear-gradient(to right, #008000,#ffad06);
  86. transition: 1s;
  87. }
  88. #progress::after{
  89. content: '';
  90. height: 0;
  91. width: 0;
  92. border-top: 20px solid transparent;
  93. border-bottom: 20px solid transparent;
  94. position: absolute;
  95. right: -20px;
  96. top: 0;
  97. border-left: 20px solid #ffad06;
  98. }

HTML (index.html)

  1. <head>
  2. <title>Registration Form with Multi Steps - TunnexCode</title>
  3. <link rel="stylesheet" href="style.css">
  4. </head>
  5. <body>
  6. <div class="container">
  7. <div class="step-row">
  8. <div id="progress"></div>
  9. <div class="step-col"><small style="color: white;">Step 1</small></div>
  10. <div class="step-col"><small style="color: white;">Step 2</small></div>
  11. <div class="step-col"><small style="color: white;">Step 3</small></div>
  12.  
  13. </div>
  14. <form id="step1">
  15. <h3>PERSONAL DATA</h3>
  16. <input type="text" name="fname" placeholder="First Name" required>
  17. <input type="text" name="lname" placeholder="Last Name" required>
  18. <input type="text" name="username" placeholder="Username" required>
  19. <div class="btn-box">
  20. <button type="button" id="Next1">Next</button>
  21. </div>
  22. </form>
  23. <form id="step2">
  24. <h3>CONTACT</h3>
  25. <input type="text" name="email" placeholder="Email" required>
  26. <input type="text" name="phone" placeholder="Phone Number" required>
  27. <input type="file" name="image" accept="image/*">
  28. <div class="btn-box">
  29. <button type="button" id="Previous1">Previous</button>
  30. <button type="button" id="Next2">Next</button>
  31. </div>
  32. </form>
  33. <form id="step3">
  34. <h3>SECURITY</h3>
  35. <input type="password" name="password_1" placeholder="Password" required>
  36. <input type="password" name="password_2" placeholder="Confirm Password" required>
  37. <div class="btn-box">
  38. <button type="button" id="Previous2">Previous</button>
  39. <button type="button" id="submit">Submit</button>
  40. </div>
  41. </form>
  42.  
  43. </div>
  44.  
  45. <script src="./scripts.js"></script>
  46. </body>
  47. </html>

JavaScript (scripts.js)

  1. var step1 = document.getElementById("step1");
  2. var step2 = document.getElementById("step2");
  3. var step3 = document.getElementById("step3");
  4.  
  5. var Next1 = document.getElementById("Next1");
  6. var Next2 = document.getElementById("Next2");
  7. var Previous1 = document.getElementById("Previous1");
  8. var Previous2 = document.getElementById("Previous2");
  9.  
  10. Next1.onclick = function(){
  11. step1.style.top = "-450px";
  12. step2.style.top = "100px";
  13. progress.style.width = "240px";
  14. }
  15. Previous1.onclick = function(){
  16. step1.style.top = "100px";
  17. step2.style.top = "450px";
  18. progress.style.width = "120px";
  19. }
  20. Next2.onclick = function(){
  21. step2.style.top = "-450px";
  22. step3.style.top = "100px";
  23. progress.style.width = "360px";
  24. }
  25. Previous2.onclick = function(){
  26. step2.style.top = "100px";
  27. step3.style.top = "450px";
  28. progress.style.width = "240px";
  29. }

Sample Snapshots

Multi-step Registration Form Template

Multi-step Registration Form Template

Multi-step Registration Form Template

There you go! I also provided a zip file for the source code of this Multi-step Registration Form Template on this article. The download button is located below this article. Feel free to download and modify the template the way you wanted.

I hope this will help you with what you are looking for and you'll find the source code useful for your future web application projects.

Happy Coding :)

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment