You must validate the data from the form and output a record of all errors found in an appropriate way. Ensure that all input device values are retained in the input devices if any errors are detected. The validation rules are as follows:
• The customer id field must have a value, contain only numeric characters and be exactly 6 digits long and unique (i.e. does not already exist in the database)
• First and last name fields must have values and should not be more than 30 characters long each, contain only alphabetic characters or the hyphen(-‐) character
• If address details are provided a value for state should be selected and postcode should only
contain numeric characters and be exactly 4 digits long.
Comments
Leave a comment