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
"Modal Demo"
Bootstrap 2.3.2 Snippet by
escapedlion
2.3.2
modal
Preview
HTML
JS
View Full Screen
Fork
Fork this
5.4K
 
2 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!-- Bootstrap trigger to open modal --> <a data-toggle="modal" href="#rating-modal">Write a Review</a> <div class="hide fade modal" id="rating-modal"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h2>Your Review</h2> </div> <div class="modal-body"> <!-- The async form to send and replace the modals content with its response --> <form class="form-horizontal well" data-async data-target="#rating-modal" action="" method="POST"> <fieldset> <table> <tr> <td>Name:</td> <td><input name="name" type="text"></input></td> </tr> <tr> <td>Email:</td> <td><input name="email" type="text"></input></td> </tr> <tr> <td>Phone:</td> <td><input name="phone" type="text"></input></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit"></input></td> </tr> </table> </fieldset> </form> </div> <div class="modal-footer"> <a href="#" class="btn" data-dismiss="modal">Cancel</a> </div> </div>
jQuery(function($) { $('form[data-async]').live('submit', function(event) { var $form = $(this); var $target = $($form.attr('data-target')); $.ajax({ type: $form.attr('method'), url: $form.attr('action'), data: $form.serialize(), success: function(data, status) { $target.html(data); } }); event.preventDefault(); }); });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76