Bootstrap에는 오류, 경고 및 성공 메시지에 대한 유효성 검사 스타일이 포함되어 있습니다. 사용하려면 적절한 클래스(.has-warning, .has-error 또는 .has-success)를 상위 요소에 추가하기만 하면 됩니다.
다음 코드를 실행하여 인증 상태를 얻을 수 있습니다
실시간 데모
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <script src = "/scripts/jquery.min.js"></script> <script src = "/bootstrap/js/bootstrap.min.js"></script> </head> <body> <form class = "form-horizontal" role = "form"> <div class = "form-group"> <label class = "col-sm-2 control-label">Focused</label> <div class = "col-sm-10"> <input class = "form-control" id = "focusedInput" type = "text" value = "This is focused..."> </div> </div> <div class = "form-group"> <label for = "inputPassword" class = "col-sm-2 control-label">Disabled</label> <div class = "col-sm-10"> <input class = "form-control" id = "disabledInput" type = "text" placeholder = "Disabled input here..." disabled> </div> </div> <fieldset disabled> <div class = "form-group"> <label for = "disabledTextInput" class = "col-sm-2 control-label"> Disabled input (Fieldset disabled) </label> <div class = "col-sm-10"> <input type = "text" id = "disabledTextInput" class = "form-control" placeholder = "Disabled input"> </div> </div> <div class = "form-group"> <label for = "disabledSelect" class = "col-sm-2 control-label"> Disabled select menu (Fieldset disabled) </label> <div class = "col-sm-10"> <select id = "disabledSelect" class = "form-control"> <option>Disabled select</option> </select> </div> </div> </fieldset> <div class = "form-group has-success"> <label class = "col-sm-2 control-label" for = "inputSuccess"> Input with success </label> <div class = "col-sm-10"> <input type = "text" class = "form-control" id = "inputSuccess"> </div> </div> <div class = "form-group has-warning"> <label class = "col-sm-2 control-label" for = "inputWarning"> Input with warning </label> <div class = "col-sm-10"> <input type = "text" class = "form-control" id = "inputWarning"> </div> </div> <div class = "form-group has-error"> <label class = "col-sm-2 control-label" for = "inputError"> Input with error </label> <div class = "col-sm-10"> <input type = "text" class = "form-control" id = "inputError"> </div> </div> </form> </body> </html>
위 내용은 '부트스트랩 유효성 검사 상태'의 중국어 번역은 '부트스트랩 유효성 검사 상태'입니다.의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!