Skip to main content link. Accesskey S

The useful resource for IBM Lotus Domino XPages development

Submit Search

Home > Working with fields > Work with validation and message controls
is maintained by 
Julian Buss.
and hosted by
Julian Buss
Created by Jose Sarotto on 03.06.2011 23:17:35

Thanks for your invaluable tips.

Regarding "Check if a value is a mail address"

Instead of using


I think you need to use the expression as in the following function:


function checkEmail(str)


var eMail = /^\s*[\w\-\+\_]+(\.[\w\-\+\_]+)*@[\w\-\+\_]+\.[\w\-\+\_]+(\.[\w\-\+\_]+)*\s*$/;

if (str.match(eMail)) {

return true;

} else {

return false;




Created by Peter Leugner on 10.06.2011 22:17:14

Another easy way to run a validation only when a certain button/link is clicked is shonw below:

title="Reject this request with a comment">

value="#{Workflow.comment}" style="width:400px" rows="5">

message="Please provide a reason for the rejection in the comment field!">

Just give the eventhandler an id and check for the id in the required attribute of the field

Created by Peter Leugner on 10.06.2011 22:18:30

oops, can't post the xml, it get's filtered out :-(

Created by mathew murphy on 26.03.2014 21:27:15

The regex for e-mail address validation is WRONG.

The '+' symbol is VALID in an e-mail address.

Created by fggg on 28.04.2015 11:46:13