Bootstrap中表单控件状态(验证状态)

 

Bootstrap 表单 http://www.runoob.com/try/try2.php?filename=bootstrap3-form-controlstate (这链接里有简介)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" >
</head>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>

<style>
    .right_20{right:20px;}
</style>

<body>
    <div class="width90_">
        <form class="form-horizontal bs-example bs-example-form">
            <div class="form-group form-group-sm has-success">
                <label class="fontSize12 col-sm-4 control-label" for="old_pwd">
                    <span style = 'color:red;'></span>成功
                </label>
                <div class="col-sm-6">
                    <input maxLength = '50' class="form-control" type="text" id="old_pwd" placeholder="" >
                    <span class="glyphicon glyphicon-ok form-control-feedback right_20"></span>
                </div>
            </div>
            <div class="form-group form-group-sm has-warning">
                <label class="fontSize12 col-sm-4 control-label" for="new_pwd">
                    <span style = 'color:red;'></span>警告
                </label>
                <div class="col-sm-6">
                    <input maxLength = '50' class="form-control" type="text" id="new_pwd" placeholder="" >
                    <span class="glyphicon glyphicon-warning-sign form-control-feedback right_20"></span>
                </div>
            </div>
            
            <div class="form-group form-group-sm has-error">
                <label class="fontSize12 col-sm-4 control-label" for="re_new_pwd">
                    <span style = 'color:red;'></span>错误
                </label>
                <div class="col-sm-6">
                    <input class="form-control" type="text" id="re_new_pwd" placeholder="">
                    <span class="glyphicon glyphicon-remove form-control-feedback right_20"></span>
                </div>
            </div>
        </form>
        
    </div>
</body>
</html>
原文地址:https://www.cnblogs.com/aiyr/p/7278914.html