Further Exploring Controlled Inputs

Learn how controlled input is affected by input updates.

Reflecting changes in real-time

We haven’t yet seen the real benefit of controlled inputs, which is the ability to respond to input as it is updated. This is common for validating different types of input, such as:

  • Showing whether a password is sufficiently strong.

  • Checking that an email or a phone number is in the valid format.

  • Checking if the second time something was entered, for example, an email or a password, matches the first entry.

Without client-side scripting, it would be necessary to send back the problematic inputs to the server before catching the issue, which can be frustrating for a user. Immediate feedback speeds up the process and makes for a better experience.

Here, we add a passwordComment to be shown directly below the password. It starts empty, but once the password is first changed, it provides some advice on the password’s strength.

Get hands-on with 1200+ tech skills courses.