Validating user input

If you are interested in autoloading classes, you can check our tutorial.

It returns true on strings like 'on', 'yes', 'true' (Case-Insensitive), on boolean true. Many browsers send string "on" if a checkbox is ticked by user. Let's see an example how to convert it to a boolean. But, writing them all over and over again is not a good practice.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.The option of using pure HTML, sometimes with a touch of CSS, to complement Java Script form validation was until recently unthinkable.Sure there have been all kinds of whacky plug-ins over the years aimed at achieving this, but never a single standard that we could work towards.

Leave a Reply