"FORM"
Bootstrap 3.3.0 Snippet by makey

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row form-group"> <div class="col-xs-12"> <ul class="nav nav-pills nav-justified thumbnail setup-panel"> <li class="active"><a href="#step-1"> <h4 class="list-group-item-heading">Personal</h4> <p class="list-group-item-text">First step description</p> </a></li> <li class="disabled"><a href="#step-2"> <h4 class="list-group-item-heading">Address</h4> <p class="list-group-item-text">Second step description</p> </a></li> <li class="disabled"><a href="#step-3"> <h4 class="list-group-item-heading">Fianance</h4> <p class="list-group-item-text">Third step description</p> </a></li> <li class="disabled"><a href="#step-4"> <h4 class="list-group-item-heading">Confirmation</h4> <p class="list-group-item-text">Third step description</p> </a></li> </ul> </div> </div> <div class="row setup-content" id="step-1"> <div class="col-xs-12"> <div class="col well"> <div class="row"> <div class="col-sm-offset-4 col-sm-6"> <div class="form-group"> <label for="validate-text"><span class="req">* </span> Title</label> <div class="input-group" role="group"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <div class="btn-group btn-group-justified" role="group" > <div class="btn-group" role="group"> <button type="button" class="btn btn-default" value="mr" onclick="Validate(this)">Mr.</button> </div> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" value="mrs" onclick="Validate(this)">Mrs.</button> </div> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" value="miss" onclick="Validate(this)">Miss</button> </div> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" value="ms" onclick="Validate(this)">Ms.</button> </div> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" value="dr" onclick="Validate(this)">Dr.</button> </div> </div> </div> </div> <div class="form-group"> <label for="validate-text">Validate Text</label> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <input type="text" class="form-control" name="validate-text" id="validate-text" placeholder="Validate Text" required> </div> </div> <div class="form-group"> <label for="validate-optional">Optional</label> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <input type="text" class="form-control" name="validate-optional" id="validate-optional" placeholder="Optional"> </div> </div> <div class="form-group"> <label for="validate-optional">Already Validated!</label> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <input type="text" class="form-control" name="validate-text" id="validate-text" placeholder="Validate Text" value="Validated!" required> </div> </div> <div class="form-group"> <label for="validate-email">Validate Email</label> <div class="input-group" data-validate="email"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <input type="text" class="form-control" name="validate-email" id="validate-email" placeholder="Validate Email" required> </div> </div> <div class="form-group"> <label for="validate-phone">Validate Phone</label> <div class="input-group" data-validate="phone"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <input type="text" class="form-control" name="validate-phone" id="validate-phone" placeholder="(814) 555-1234" required> </div> </div> <div class="form-group"> <label for="validate-length">Minimum Length</label> <div class="input-group" data-validate="length" data-length="5"> <span class="input-group-addon"><span class="glyphicon glyphicon-asterisk"></span></span> <textarea type="text" class="form-control" name="validate-length" id="validate-length" placeholder="Validate Length" required></textarea> </div> </div> <div class="form-group"> <label for="validate-select">Validate Select</label> <div class="input-group"> <select class="form-control" name="validate-select" id="validate-select" placeholder="Validate Select" required> <option value="">Select an item</option> <option value="item_1">Item 1</option> <option value="item_2">Item 2</option> <option value="item_3">Item 3</option> </select> <span class="input-group-addon danger"><span class="glyphicon glyphicon-asterisk"></span></span> </div> </div> <div class="form-group"> <label for="validate-number">Validate Number</label> <div class="input-group" data-validate="number"> <input type="text" class="form-control" name="validate-number" id="validate-number" placeholder="Validate Number" required> <span class="input-group-addon danger"><span class="glyphicon glyphicon-remove"></span></span> </div> </div> </div> </div> <button id="activate:step-2" class="btn btn-primary btn-lg">go to Address</button> </div> </div> </div> <div class="row setup-content" id="step-2"> <div class="col-xs-12"> <div class="col-md-12 well text-center"> <h1 class="text-center"> STEP 2</h1> <button id="activate:step-1" class="btn btn-primary btn-lg">back to Personal</button> <button id="activate:step-3" class="btn btn-primary btn-lg">go to Fainance</button> </div> </div> </div> <div class="row setup-content" id="step-3"> <div class="col-xs-12"> <div class="col-md-12 well text-center"> <h1 class="text-center"> STEP 3</h1> <button id="activate:step-2" class="btn btn-primary btn-lg">back to Address</button> <button id="activate:step-4" class="btn btn-primary btn-lg">go to Confirmation</button> </div> </div> </div> <div class="row setup-content" id="step-4"> <div class="col-xs-12"> <div class="col-md-12 well text-center"> <h1 class="text-center"> STEP 4</h1> <button id="activate:step-3" class="btn btn-primary btn-lg">back to Finance</button> <button id="activate:step-2" class="btn btn-primary btn-lg">APPLY</button> </div> </div> </div> </div> <div><p id="info">.helllo</p></div> <div><p id="info2">.</p></div>
.input-group-addon.primary { color: rgb(255, 255, 255); background-color: rgb(50, 118, 177); border-color: rgb(40, 94, 142); } .input-group-addon.success { color: rgb(255, 255, 255); background-color: rgb(92, 184, 92); border-color: rgb(76, 174, 76); } .input-group-addon.info { color: rgb(255, 255, 255); background-color: rgb(57, 179, 215); border-color: rgb(38, 154, 188); } .input-group-addon.warning { color: rgb(255, 255, 255); background-color: rgb(240, 173, 78); border-color: rgb(238, 162, 54); } .input-group-addon.danger { color: rgb(255, 255, 255); background-color: rgb(217, 83, 79); border-color: rgb(212, 63, 58); }
$(document).ready(function() { var navListItems = $('ul.setup-panel li a'), allWells = $('.setup-content'); allWells.hide(); navListItems.click(function(e) { e.preventDefault(); var $target = $($(this).attr('href')), $item = $(this).closest('li'); if (!$item.hasClass('disabled')) { navListItems.closest('li').removeClass('active'); $item.addClass('active'); allWells.hide(); $target.show(); } }); $('ul.setup-panel li.active a').trigger('click'); // DEMO ONLY // $('#activate-step-1').on('click', function(e) { $("#info").text($(this).attr('id')); //$('ul.setup-panel li:eq(1)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-1"]').trigger('click'); //$(this).remove(); }) $('#activate-step-2').on('click', function(e) { $("#info").text($(this).attr('id')); //$('ul.setup-panel li:eq(1)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-2"]').trigger('click'); //$(this).remove(); }) $('#activate-step-3').on('click', function(e) { $("#info").text($(this).attr('id')); //$('ul.setup-panel li:eq(2)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-3"]').trigger('click'); //$(this).remove(); }) $('#activate-step-4').on('click', function(e) { $("#info").text($(this).attr('id')); //$('ul.setup-panel li:eq(3)').removeClass('disabled'); $('ul.setup-panel li a[href="#step-4"]').trigger('click'); //$(this).remove(); }) $('button').on('click', function(e) { $("#info2").text($(this).attr('id')) var target = $(this).attr('id').split(':')[1]; var temp = target.split("-")[1] - 1; $('ul.setup-panel li:eq(' + temp + ')').removeClass('disabled'); $('ul.setup-panel li a[href="#' + target + '"]').trigger('click'); }); }); function Validate(title) { var $button = $(this).closest('input-group-addon'); $( "#test").text(" validate: " + title.value); var $group = $(title).closest('.input-group'), $addon = $group.find('.input-group-addon'), $icon = $addon.find('span'); if(title.value !== "") { $addon.addClass('success'); $icon.attr('class', 'glyphicon glyphicon-ok'); }else{ $addon.addClass('danger'); $icon.attr('class', 'glyphicon glyphicon-remove'); } }

Related: See More


Questions / Comments: