The Chinese translation of 'Bootstrap Validation States' is 'Bootstrap Validation States'

PHPz
Release: 2023-08-26 23:53:02
forward
799 people have browsed it

"Bootstrap Validation States"的中文翻译是"Bootstrap验证状态"

Bootstrap includes validation styles for error, warning, and success messages. To use, simply add the appropriate class (.has-warning, .has-error or .has-success) to the parent element.

Example

You can try to run the following code to achieve the verification status

Real-time demonstration

<!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>
Copy after login

The above is the detailed content of The Chinese translation of 'Bootstrap Validation States' is 'Bootstrap Validation States'. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template