'Bootstrap Validation States'的中文翻譯是'Bootstrap驗證狀態'

PHPz
發布: 2023-08-26 23:53:02
轉載
797 人瀏覽過

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

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>
登入後複製

以上是'Bootstrap Validation States'的中文翻譯是'Bootstrap驗證狀態'的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:tutorialspoint.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板