Fork me on GitHub

Nibble Development

Nibble Development

PHP classes and libraries for developers

Password field

The password field is an extension of the text field. This means that the same options/arguments apply, however there are two additional, optional, arguments to further customise the field:

  1. Minimum length: The second argument in the password function is the required minimum length of the string entered by the user. Any number can be entered including 0 if no minimum limit is required.
  2. Alphanumeric: The third argument adds alphanumeric validation to the password field. It is not true alphanumeric validation, rather it forces the user to enter at least one numeric character and one alphabetic character in the string. The value can be True or False, True turns on the “alphanumeric” validation.

As there are two additional arguments, the second, third and fourth arguments in the text field become the fourth, fifth and sixth arguments respectively  Below is an example of a fully customised password field:

As mentioned in the simple setup section above, a confirmation field can be easily added to each password field created. The confirmation field only has one argument, the label. To add this field simply call the PHP method addConfirmation()  on the password field object:

Luke Rotherfield

Freelance PHP Developer
is a PHP developer dedicated to writing the most awesome liraries for his fellow devs :) enjoy

Latest posts by Luke Rotherfield (see all)

Leave a Comment