When you use JS function to validate a form and a JavaScript raise an Error, you validation script abord and the document is save with invalide data.
Here is the solution:
On the form put the fields
SaveOptions Editable
Value "1"
HTML ATTRIBUT "type=hidden"
Hide When [Notes] && [READ]
function OnErrorHandler(msg, url, lno) {
// Trap error , Do not save the doc
document.forms[0].SaveOptions.value="0";
return(true);
}
function ValideMe(form){
//validation du formulaire
window.onerror = OnErrorHandler
if(isEmpty(getFieldValue (form.XICOVR,"text") )){
alertBox (form.btCOVR, msg, "buton" )
return(false);
}
//.............
// You validation Code goes here
//
return(true);
}
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
This was first published in February 2001