
For anyone who read my past article on the extensible javascript validation class(es) that I wrote, the true intention was for easy use on a domino form. So lets take a look at how to add it in.
- First off it is based on the great Prototype Library, pick it up if you haven’t already.
- grab my validation class, create 2 new javascript libraries and copy the code into them.
- Open up the form you wish to add validation to and go to the ‘JS Header’ section.
- Create>Resource>Insert Resource – select prototype.js
- Repeat for validate.js
- Go to the ‘onLoad’ event for the form and create a validation object, as long as you dont have any pass through form tags on the field you can reference the form via ‘0′ or ‘_formname’ using the name of your form (Example: new Validation(“_contact”); )
- Ok now pick which fields you want to validate, select the field and open the field properties
- on the HTML tab (last one) you can set the class values that will pass through to the html tag, all fields you want to validate must include the ‘validate’ class.
- Also add a class based off which type of validation you want, built in choices are: numeric, date, email, phone, zip, password, name, required.
An example class for email validation would be ‘validate email’
Save the form and you’re done. I posted a bit more previously on how it handles validation and plan to write some information on how to customize it to your needs and add additional validator objects to it.
Technorati: SnTT

[...] If your doing Domino web work take a look at “SnTT 1: Easy JS Validation on a Form, although (evil thought) I wonder if something like this could work in the notes client javascript support? You still need back end validate though. (which leads to another evil thought – 2 in one morning? !!) about using RSJ templates to generante the javascript for validatation based on the RubyOnRails meta data … hmm) [...]
False Positives » Blog Archive » SnTT : LotusScript Required Field Validation without pain
April 27th, 2006
good
revathi
May 12th, 2006
Very neat.
i question – if a field needs two validations – say required and email, is that possible? i tried ‘validate required email’ but didnt work.
vinay
May 25th, 2006
‘validate required email’ is one I’ve used and had working, was anything else changed? do they work separately? I’ll try my best to help figure out whats not working.
Rich Waters
May 26th, 2006
[...] I then went through a couple of other basic examples using Prototype / Scriptaculous, including a quick ajax autocompletion and a demo of my prototype based javascript validation. [...]
Rich Waters » Blog Archive » Condug Presentation
December 6th, 2006
Hej, can you send / post a working example? I have implemented your code but there is no validation running when I submit my form…
Thanks in advance
Patrick Kwinten
October 1st, 2007
Patrick,
did you make sure to change the bottom section to correspond to your form name?
Event.observe(window,”load”,function() {
var val = new Validation(“_contact”);
});
Rich Waters
October 1st, 2007
Patrick,
this may be a slightly older version, but it shows the validation working on a form:
http://www.rich-waters.com/blog/code/demo.html
Rich Waters
October 1st, 2007
Hello. And Bye.
XRumerTest
October 1st, 2008
http://www.tootobuy.com gsm phone wholesale phones slider phone china cellphone
vincent
June 16th, 2010