Skip to content

Instantly share code, notes, and snippets.

@tararoutray
Last active July 30, 2023 16:04
Show Gist options
  • Save tararoutray/2155e6e7a707db5b7e5950703f27c096 to your computer and use it in GitHub Desktop.
Save tararoutray/2155e6e7a707db5b7e5950703f27c096 to your computer and use it in GitHub Desktop.
<div>
<h1>Create a Multi-Step Form Using HTML, CSS, and JavaScript</h1>
<div id="multi-step-form-container">
<!-- Form Steps / Progress Bar -->
<ul class="form-stepper form-stepper-horizontal text-center mx-auto pl-0">
<!-- Step 1 -->
<li class="form-stepper-active text-center form-stepper-list" step="1">
<a class="mx-2">
<span class="form-stepper-circle">
<span>1</span>
</span>
<div class="label">Account Basic Details</div>
</a>
</li>
<!-- Step 2 -->
<li class="form-stepper-unfinished text-center form-stepper-list" step="2">
<a class="mx-2">
<span class="form-stepper-circle text-muted">
<span>2</span>
</span>
<div class="label text-muted">Social Profiles</div>
</a>
</li>
<!-- Step 3 -->
<li class="form-stepper-unfinished text-center form-stepper-list" step="3">
<a class="mx-2">
<span class="form-stepper-circle text-muted">
<span>3</span>
</span>
<div class="label text-muted">Personal Details</div>
</a>
</li>
</ul>
<!-- Step Wise Form Content -->
<form id="userAccountSetupForm" name="userAccountSetupForm" enctype="multipart/form-data" method="POST">
<!-- Step 1 Content -->
<section id="step-1" class="form-step">
<h2 class="font-normal">Account Basic Details</h2>
<!-- Step 1 input fields -->
<div class="mt-3">
Step 1 input fields goes here..
</div>
<div class="mt-3">
<button class="button btn-navigate-form-step" type="button" step_number="2">Next</button>
</div>
</section>
<!-- Step 2 Content, default hidden on page load. -->
<section id="step-2" class="form-step d-none">
<h2 class="font-normal">Social Profiles</h2>
<!-- Step 2 input fields -->
<div class="mt-3">
Step 2 input fields goes here..
</div>
<div class="mt-3">
<button class="button btn-navigate-form-step" type="button" step_number="1">Prev</button>
<button class="button btn-navigate-form-step" type="button" step_number="3">Next</button>
</div>
</section>
<!-- Step 3 Content, default hidden on page load. -->
<section id="step-3" class="form-step d-none">
<h2 class="font-normal">Personal Details</h2>
<!-- Step 3 input fields -->
<div class="mt-3">
Step 3 input fields goes here..
</div>
<div class="mt-3">
<button class="button btn-navigate-form-step" type="button" step_number="2">Prev</button>
<button class="button submit-btn" type="submit">Save</button>
</div>
</section>
</form>
</div>
</div>
@raghukalia2005
Copy link

Is this code still working I paste all the three codes in in one html file but form is not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment