Skip to main content link. Accesskey S

XPages Wiki

Submit Search

YouAtNotes XPages Wiki


Home > Working with fields > Work with validation

Work with validation

ShowTable of Contents

Use your own validation tests


Create a Expression Validator and use JavaScript for comparing stuff. The value of the fields is stored in the variable "value".

value == sessionScope.get("comparevalue");


Here the validator is true if the value of the fields is the same than the value of "comparevalue" in the sessionScope.

Note: if you have a radio button group, you need the validator only in the first field of the group.

Check if one date is greate as the other


var start = value;
var end = getComponent("D_END").getValue();
if (!start) return false;
if (!end) return false;
var dStart:NotesDateTime = session.createDateTime(start);
var dEnd:NotesDateTime = session.createDateTime(end);

return (dEnd.timeDifference(dStart) > 0 )

Check if a value is a mail address


Use a constraints validator with this regex:

^s*[w-+_]+(.[w-+_]+)*@[w-+_]+.[w-+_]+(.[w-+_]+)*s*$

Run validation only on a button click


Standard validators are running on each (full / partial) update, which can be very annoying.
IBM is aware of that problem in 851 and is working on a general solution.

In the meantime, Tommy Valand developed a good workaround. Click here to see Tommy's solution
See what's possible with Xpages.
Have a look at our ServiceCommunicator website
and the YouAtNotes Support.
Use  searchlotus.com  for news in the Web related to Lotus Notes and Domino,
and to search those sites.
Check  youatnotes.com  for great Lotus Notes, Domino and XPages software.
Did this wiki help you?
Did this saved you time? Express your gratitude by making a donation:
PayPal - The safer, easier way to pay online!