Microsoft.Common.PasswordBox UI 元素

可使用控制項來提供及確認密碼。

UI 範例

Screenshot of Microsoft.Common.PasswordBox UI element.

結構描述

{
  "name": "element1",
  "type": "Microsoft.Common.PasswordBox",
  "label": {
    "password": "Password",
    "confirmPassword": "Confirm password"
  },
  "toolTip": "",
  "constraints": {
    "required": true,
    "regex": "^[a-zA-Z0-9]{8,}$",
    "validationMessage": "Password must be at least 8 characters long, contain only numbers and letters"
  },
  "options": {
    "hideConfirmation": false
  },
  "visible": true
}

範例輸出

"p4ssw0rd"

備註

  • 此元素不支援 defaultValue 屬性。
  • 如需 constraints 的實作詳細資料,請參閱 Microsoft.Common.TextBox
  • 如果將 options.hideConfirmation 設為 true,就會將確認使用者密碼的第二個文字方塊加以隱藏。 預設值為 false

下一步