brandnewbox.co.uk

Validation with javascript

This had been superceded by version 2.

A form to demonstrate some of the javascript validation tests possible.

Validation is set up using the 'fairly-readable' javascript function:

function validateForm(f) {

      f.username.isAlpha = true;
      f.username.isLengthBetween = [4,8];
      f.email.isEmail = true;
      f.pwd1.isAlphaNumeric = true;
      f.pwd1.isLengthBetween = [4,16];
      f.pwd2.isMatch = f.pwd1.value;
      f.conditions.isChecked = true;
      f.text.isOptional = true;

      return performFormValidate(f);
      }