logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • Rob
    • Posted on Mon 5 Jun 2006 11:41 AM

    "An ounce of error prevention is worth a pound of error detection."

    Whenever possible I like to make errors during data entry impossible. For example, if a field requires numbers, then a key filter that only permits numbers to be entered into a field is a bit better than telling the user they have entered invalid data after they click the submit button.

    Dates are always a pain so a date picker of some sort is better. This makes invalid date entry impossible.

    In Notes I often do the following:

    1. Create a single date field that is hidden from the web..

    2. Create three separate fields; month, day and year as list boxes.

    3. Add JavaScript to set the number of days in the day field based on the month and year fields.

    4. On submission I use formula language to build and validate the single date field.

    5. When opening an existing document for editing I use formula language to set the values in the month, day and year fields based on the value in the single date field.

    If this is all done correctly it should be impossible to enter an invalid date.

    Rob:-]

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: