Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Kjeld 2"
Bootstrap 3.3.0 Snippet by
jethrotenb
3.3.0
jQuery
Preview
HTML
CSS
JS
View Full Screen
Forked from
Fork
Fork this
Parent
518
 
0 Fav
Post to Facebook
Tweet this
<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"> <div class="control-group" id="fields"> <label class="control-label" for="field1">Nice Multiple Form Fields</label> <div class="controls"> <form role="form" autocomplete="off"> <div class="entry input-group col-xs-3"> <input class="form-control" type="text" /> </div> <div class="entry input-group col-xs-3"> <input class="form-control" type="text" id="jethro2" /> </div> <div class="entry input-group col-xs-3"> <input class="form-control" type="text" /> </div> <div class="entry input-group col-xs-3"> <input class="form-control" id="jethro" type="text" disabled /> <span class="input-group-btn"> <button class="btn btn-success btn-add" type="button" id="button2" class="button2"> <span class="glyphicon glyphicon-plus"></span> </button> </span> </div> </form> <br> <small>Press <span class="glyphicon glyphicon-plus gs"></span> to add another form field :)</small> </div> </div> </div> </div>
.entry:not(:first-of-type) { margin-top: 10px; } .glyphicon { font-size: 12px; }
$(function() { $(document).on('click', '.btn-add', function(e) { e.preventDefault(); $( "#jethro" ).prop( "disabled", false ); $("#button2").removeClass('btn-add').addClass('btn-remove') .removeClass('btn-success').addClass('btn-danger'); }).on('click', '.btn-remove', function(e) { $( "#jethro" ).prop( "disabled", true ); $("#jethro").val(""); $("#button2").removeClass('btn-remove').addClass('btn-add') .removeClass('btn-danger').addClass('btn-success'); e.preventDefault(); return false; }); });
Related:
See More
Free Template
Login and Register Modal
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76