These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Regular Expressions

R_Boyd
Registered: Nov 1 2007
Posts: 151

Similar to my problem with converting a big chunk of validation into smaller chunks of functions I am trying to use Regular Expressions to handle the validation of many, many time fields.
 
I have a set of FormCalc scripts to calculate the various values for days, hours and the gain/loss of hours over a four week period. For these scripts to work the time format must be in HH:MM.
 
Accessibility guidelines nix any use of message box pop ups so I wanted to get around this by having a hidden/visible field with warning text but can't get it to work.
 
So far I have:
 
var r = new RegExp(); // Create a new Regular Expression Object
r.compile ("^[00-99]:\\] + [00-59]");
 
var result = r.test(this.rawValue);
 
if (result == true){
true;
form1.flow.page.parent.part2.part2body.errorMessage.presence = "visible";
}
else (result == false){
false;
form1.flow.page.parent.part2.part2body.errorMessage.presence = "hidden";
}

My Product Information:
LiveCycle Designer, Windows
djinges
Registered: Jun 27 2007
Posts: 55
HI R_Boyd,

trying with
r.compile(/^00-99]:\\] + [00-59]$/);

Then, u can write it shorter:
obj.presence = r.test(this.rawValue) ? "visible" : "hidden";

Hope, it will help you someway!?

Djinges