I've been working on a simple method for cross-client validation ever since I discovered how powerful the JS-methods in the Notes client was. Of course, it can't compare to the JS-engines in the web-browser, but you can still have a lot of (geek-) fun with what's available.
Since this is a Show'n Tell Thursday post, it's only reasonable to post the validation-demo database for people to play with.
If you just want to se how it works, I've prepared two flash-animations demoing how it looks in Notes, and how it looks on the web.
In the Notes client
On the web
For the web, I'm using Dexagogo's lovely validation library. I've also overloaded Notes' _doClick function so that it only runs if the form is valid (look in the database for the code).
In notes, the DOM is too simple to be able to do any real animation. I've made a simple "yellow fade". To achieve this, and to always have the error-messages available to view for the user, I've had to use a frameset. The validation script in notes is pretty crude.
The script that both Notes and Web use
And finally, the database. In Notes, the demo is the "WithValidation" frameset. On the web, open the "FramedValidation" form (forgot to rename the form to a better name before I uploaded the zip). FramedValidation is also used in Notes as the main form.
Other fun things you can do with JS in the Client:
Run LotusScript by triggering Entering/Exiting events
Use LS libraries (JS2LS anyone?)
To do this, fill value of field equal to a function-call (e.g. ..value="Call refreshForm()").
In the Entering event on the field, execute the value. Or, you could have a field for the method you're after, and just focus() on the field. You can hide the field with a layer (put it in a subform to make it re-usable).
Fill data in fields across framesets
Fill data into computed fields
(same with editable fields)
Use regular expression to validate fields.
Some of the stuff that I couldn't get to work:
Cross frameset event-triggering.
Using focus() to jump from a Native OS Field (with focus) to a Notes-field. Most people probably use either one or the other type, so this is probably not a big issue.
Click on buttons/actions using click(). They don't seem to be in the Notes' DOM.
Tell me the rest. I've probably (hopefully) just scratched the surface. :)
Update (02.03.07): Per Kevin's request, I've added a form where you can make per-form configurations. I placed a field on the demo-form with a @DbLookup that gets the configuration. Using eval, I convert the config-field to an object.
The structure of the validations is that of an Object literal. Once you understand how it works, it's really quite simple.
Do a google search on "Object literal" or "JSON" for more information.
I've also added a simple menu in notes, and a simple JS-testing frameset.