Bootstrap 3 Template

This is a simple Twitter Bootstrap 3 template. You can fork it to get a ready to use Bootstrap 3 fiddle.

by Aditya Sharma

HTML

<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">
  Add user
</button>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <form action="" method="post" id="saveperson">
            <label for="newcat">Project Name</label>
            <input type="text" name="newcat" value="">
            <label for="description">Description</label>
            <input type="text" name="description" value="">
            <input type="submit" name="user" value="Submit">
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>

CSS

/* Latest compiled and minified CSS included as External Resource*/

/* Optional theme */
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');

body {
    margin: 10px;
}

JavaScript

$(document).ready(function() {
    $('#saveperson').submit(function(event) { //Trigger on form submit
      $.ajax({ //Process the form using $.ajax()
        type      : 'POST', //Method type
        url       : 'process.php', 
        data      : jQuery(this).serialize(), //Forms name
        dataType  : 'json',
        success   : function(data) {
            $('.modal-body').html("Done!");
          }
      });
      event.preventDefault(); 
    });
});