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
"Reset modal form on modal close"
Bootstrap 3.3.0 Snippet by
subhash4web
3.3.0
Preview
HTML
JS
View Full Screen
Fork
Fork this
1.7K
 
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="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="jumbotron"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#resetModalForm">Open Model</button> </div> <div class="modal fade" id="resetModalForm" > <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <div class="form-group"> <label>Input:</label> <input type="text" class="form-control" id="resetInput"> </div> <div class="form-group" id="resetCheckbox"> <label class="checkbox-inline"><input type="checkbox" value=""> Option 1</label> <label class="checkbox-inline"><input type="checkbox" value=""> Option 2</label> </div> <div class="form-group" id="resetRadio"> <label class="radio-inline"><input type="radio" name="optradio" checked> Option 1</label> <label class="radio-inline"><input type="radio" name="optradio"> Option 2</label> </div> <div class="form-group"> <label>Select list:</label> <select class="form-control" id="resetDropdown"> <option value="0">Select</option> <option value="1">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> </select> </div> <div class="form-group"> <label for="comment">Textarea:</label> <textarea class="form-control" rows="2" id="resetTextarea"></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" id="request_entity" class="btn btn-primary"> Save changes </button> </div> </div> </div> </div>
$( document ).ready(function() { $('#resetModalForm').on('hide.bs.modal', function (e) { $('#resetInput').val(''); $('#resetDropdown').prop('selectedIndex',0); $('#resetRadio input[type="radio"]').prop('checked',0); $('#resetCheckbox input[type="checkbox"]').prop('checked',0); $('#resetTextarea').val(''); }); });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76