Forms Validation States - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Form Control

Description

Forms Validation States

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head> 
  <meta charset="utf-8"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <title>Example of Bootstrap 3 Forms Validation States</title> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

 </head> <!--from  www .j  a va  2s  . c o m-->
 <body> 
  <div> 
   <form class="form-horizontal"> 
    <div class="form-group has-success"> 
     <label class="col-xs-2 control-label" for="inputSuccess">Username</label> 
     <div class="col-xs-10"> 
      <input type="text" id="inputSuccess" class="form-control" placeholder="Input with success"> 
      <span class="help-block">Username is available</span> 
     </div> 
    </div> 
    <div class="form-group has-warning"> 
     <label class="col-xs-2 control-label" for="inputWarning">Password</label> 
     <div class="col-xs-10"> 
      <input type="password" id="inputWarning" class="form-control" placeholder="Input with warning"> 
      <span class="help-block">Password strength: Weak</span> 
     </div> 
    </div> 
    <div class="form-group has-error"> 
     <label class="col-xs-2 control-label" for="inputError">Email</label> 
     <div class="col-xs-10"> 
      <input type="email" id="inputError" class="form-control" placeholder="Input with error"> 
      <span class="help-block">Please enter a valid email address</span> 
     </div> 
    </div> 
   </form> 
  </div>   
 </body>
</html>

Related Tutorials