"Form"
Bootstrap 3.3.0 Snippet by fakhreddine

<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-fluid" style="margin-top: 5%;"> <div class="col-md-4 col-md-offset-4"> <div class="panel panel-primary"> <div class="panel-heading">Login</div> <div class="panel-body"> <form role="form"> <!-- Email Field --> <div class="row"> <div class="form-group col-xs-12"> <label for="email"><span class="text-danger" style="margin-right:5px;">*</span>Email:</label> <div class="input-group"> <input class="form-control" id="email" type="text" name="email" placeholder="Email Address" pattern="^[a-zA-Z0-9._%+-]{1,64}@(?:[a-zA-Z0-9-]{1,63}\.){1,125}[a-zA-Z]{2,63}$" required/> <span class="input-group-btn"> <button class="btn btn-primary"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></button> </span> </span> </div> </div> </div> <!-- Content Field --> <div class="row"> <div class="form-group col-xs-12"> <label for="content"><span class="text-danger" style="margin-right:5px;">*</span>Content:</label> <textarea class="form-control" rows="5" placeholder="Content" onkeyup="countChar(this)"></textarea> <div id="charNum"></div> </div> </div> <div class="row"> <div class="form-group col-xs-4"> <button class="btn btn-primary" type="submit">Submit</button> </div> </div> </form> </div> </div> </div>
function countChar(val) { var len = val.value.length; if (len >= 500) { val.value = val.value.substring(0, 500); } else { $('#charNum').text(500 - len); } };

Related: See More


Questions / Comments: