PasswordTextBox
PasswordTextBox lets the user enter a password with the text hidden.
Selector
smart-password-text-box
Properties
Events
Methods
Properties
animation"none" | "simple" | "advanced"
Specifies or retrieves the current animation mode. When set to 'none', all animations are disabled. If set to any other supported value, animations will be enabled according to the specified mode.
Allowed Values
- "none" - animation is disabled
- "simple" - ripple animation is disabled
- "advanced" - all animations are enabled
Default value
"advanced"Example
Set the animation property.
<smart-password-text-box animation='none'></smart-password-text-box>
Set the animation property by using the HTML Element's instance.
const passwordtextbox = document.querySelector('smart-password-text-box');
passwordtextbox.animation = 'simple';
Get the animation property.
const passwordtextbox = document.querySelector('smart-password-text-box');
let animation = passwordtextbox.animation;
autoFocusboolean
Indicates that the element will automatically receive keyboard focus as soon as the page is loaded, allowing users to interact with it immediately without clicking or tabbing to it. This is often used to improve accessibility and streamline user interaction with form fields or interactive elements.
Default value
falseExample
Set the autoFocus property.
<smart-password-text-box auto-focus></smart-password-text-box>
Set the autoFocus property by using the HTML Element's instance.
const passwordtextbox = document.querySelector('smart-password-text-box');
passwordtextbox.autoFocus = false;
Get the autoFocus property.
const passwordtextbox = document.querySelector('smart-password-text-box');
let autoFocus = passwordtextbox.autoFocus;
disabledboolean
Determines whether the element is interactive or inactive. When enabled, users can interact with the element; when disabled, the element becomes unresponsive to user actions such as clicks or input.
Default value
falseExample
Set the disabled property.
<smart-password-text-box disabled></smart-password-text-box>
Set the disabled property by using the HTML Element's instance.
const passwordtextbox = document.querySelector('smart-password-text-box');
passwordtextbox.disabled = false;
Get the disabled property.
const passwordtextbox = document.querySelector('smart-password-text-box');
let disabled = passwordtextbox.disabled;
enterKeyBehavior"clearOnSubmit" | "submit"
Defines the action that occurs when the "Enter" key is pressed within the input field. By default, the mode is set to "submit", meaning pressing "Enter" will attempt to submit the associated form. You can customize this behavior by specifying alternative modes, such as preventing form submission or triggering a custom handler.
Allowed Values
- "clearOnSubmit" - Clears the value of the input on Submit.
- "submit" - Submits the value of the input but doesn't clear it.
Default value
"submit"Example
Set the enterKeyBehavior property.
<smart-password-text-box enter-key-behavior='newLine'></smart-password-text-box>
Set the enterKeyBehavior property by using the HTML Element's instance.
const passwordtextbox = document.querySelector('smart-password-text-box');
passwordtextbox.enterKeyBehavior = 'submit';
Get the enterKeyBehavior property.
const passwordtextbox = document.querySelector('smart-password-text-box');
let enterKeyBehavior = passwordtextbox.enterKeyBehavior;
formstring
Specifies the form element with which this element is associated (referred to as its "form owner"). The value of this attribute should be the id of a