logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • Bernard Devlin
    • Posted on Wed 7 Dec 2005 02:11 AM

    For the past few weeks I've been working on a generic solution to field validation in Domino, and I think it might be of some help with regard to the server-side validation issues. The basic overview works like this:

    once the form is submitted each field validates itself and saves validation information to the form as flags eg. field1InvalidChars:=1, field1InvalidNumber:=0. When the WQS runs it checks if any of the validation flags has been set to invalid, and if not sets SaveOptions to true. If SaveOptions is not true, then the form is invalid, and $$Return sends the user back to the form with something like "?OpenForm&field1=Some_Stuff&field1InvalidChars=1&field1InvalidNumber=0".

    This means that not only is the user returned to the form with the fields populated with their previous entries, but also that the validation flags can be used in computed fields to show which fields are invalid and display help associated with that field.

    In my app I abbreviate all the validation flags in the url (&f1ivc=1&f1ivn=0) - as you can imagine, the URL could get very long, and it looks like 2048 characters is the maximum for the path component. I have got the InputValidation event of the form generic enough now so that it only requires a few lines of individuation at the start of each field, and then the relevant validation limits are populated from a profile document, and each field not only records its own validity state, but also adds itself and its values to the user values to be returned in the url and adds its validation flags to the list to be returned in the url. Now validation control and user feeback are controlled on a field by field basis from a profile document.

    I don't need to avoid JavaScript for this app, so I have never really looked at that URL command. I think this is still going to require JavaScript when it comes to saving the form (I'm still calling a _doClick()). So it doesn't answer that 'accessibility' problem. However, surely there is some way round this using the ?SaveDocument URL command?

    I hope this is of some help to you. Over the past few years I've learned a lot from people like you and Stan, and I'd be chuffed to give something back.

Your Comments

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