Skip to main content

Confirm Password UI Component

The confirm password UI component can be used together with the password UI component to validate the password that is inputted. This component ensures that both passwords entered, match.


The confirm password UI component requires the password UI component to be embedded in the same form.

Embed the Confirm Password UI Component‚Äč

The Confirm Password UI component accepts a password and checks that it matches the password that was entered by the user in the password UI component.


To use Weavr UI components, you must first set up the Weavr UI library in your application.

<!-- Define a form in which you will ask your customer to enter and confirm their password -->
<form onSubmit="onSubmit(); return false;">
<label>Password Confirmation</label>
<div id="input-password"></div>
<br />
<div id="input-password-confirm"></div>
<br />

<input type="submit" value="confirm" />
<div id="inputPasswordConfirmResponse"></div>

<script type="text/javascript">
// Create an instance of a secure form
const form = window.OpcUxSecureClient.form();

// Create an instance of a secure Password component
const password = form.input("password", "password", {
placeholder: "Password",
// Create an instance of a secure Confirm Password component
const confirmPassword = form.input("confirmPassword", "confirmPassword", {
placeholder: "Confirm Password",

// Mount the components

// Define a function that will be executed when the form is submitted by the user
function onSubmit() {
// Call tokenize to check the passwords match and
// tokenise the password inputted by your customer
(res) => {
document.getElementById("inputPasswordConfirmResponse").innerText =
(err) => {
console.error("Error:", err.message);
document.getElementById("inputPasswordConfirmResponse").innerText =
"ERROR: " + JSON.stringify(err);