Html code for validating password
In this article we intend to present only a number of simple examples to get you started, covering the basic form elements.
Before you ask, and someone always does, these examples will currently work in the following browsers: Safari 5, Chrome 6, Opera 9, Firefox 4 Beta and the i Phone/i Pad.
Extending the Script Changing the colors is a great visual identifier for the user, but for added security, the script could be extended to disable the form submit button or alert the user before they submit the form if the passwords do not match.
Hopefully these behaviours will converge in future releases.
For these examples we have created our own valid/invalid CSS formatting to override the browser default. That's why you may see something like the following: Before you type anything into the box a red marker is shown.
As soon as a single character has been entered this changes to a green marker to indicate that the input is 'valid'.
Using CSS you can place markers inside or alongside the input box, or simply use background colours and borders as some browsers do by default. On the i Phone/i Pad the different input types are associated with different keyboards, making it easier for people to complete your online forms.
In other web browsers they can be used in combination with the .