Enabling validators on the fly

In the following form, the new password is not required. Its validators are disabled. When user set the password, the validators will be enabled.

Initially, all validators of new password and confirmation password are disabled:

Then enable them if the new password is not empty:

More examples

Related validators

The following validators might be useful to you.