home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Dashed Number Field Javascript Validation
Mindwatering Incorporated
Author: Tripp Black
Created: 03/20/2007 at 10:45 PM
Category:
Notes Developer Tips
JavaScript
The function below tests/validates a dashed or undashed number field.
In the example below, it is assumed that the number is either entered with its dashes or without its dashes.
function CheckNo(fldno) {
// validates item format of 11-12345-1234
var matchArr = itemno.match(/^(\d{2})-?\d{5}-?\d{4}$/); // tests for dashed formated number string
var matchNumArr = itemno.match(/\d{11}/); // tests for all number string
// alert ('match:' + matchArr);
if ((itemno.length == 13 && matchArr != null) || (itemno.length == 11 && matchNumArr != null)){
return true;
} else {
// bad format
return false;
}
}
previous page
×