Is there a pattern I can use or do I have to create a custom script? If I
use this:
this.rawValue
>= 0 && this.rawValue <= 3;
if
(this.rawValue < 1) {
this.rawValue
= 0;
}
if
(this.rawValue > 3) {
this.rawValue
= 0;
}
I get a validation error for every field (70 of them) when the form opens and there is a message box on each filed. I tried a default value of 0 for each field but still get the message.
The field can be null, 0 (when turned off) ot 1,2 or 3.
Solved! Go to Solution.
Views
Replies
Total Likes
and operator in Java Script is "&&" and in FormCalc it is "and"
or operator in Java Script is "||" (double pipe) and in FormCalc it is "or"..
Otherway way of doing your code is:
//Execute the below statements only if the value is not null
if(this.rawValue != null){
if(this.rawValue <1) {
this.rawValue= null;
}
if(this.rawValue > 3) {
this.rawValue= null;
}
}
Thanks
Srini
Views
Replies
Total Likes
When I change the value to null, the validation messages are not displaying..
if(this.rawValue <1) {
this.rawValue= null;
}
if(this.rawValue > 3) {
this.rawValue= null;
}
Will this help?
Patterns only check for whether the user is entering the input in a particular format. You may not be able to place script as part of pattern.
Make this script as part of a Scrip Object and call the script in all of the fields where ever you need. That way script maintenance will be easier.
Thanks
Srini
Thanks, Srini, I'll give it a shot.
Views
Replies
Total Likes
While it works, I do not get any validation message at all.
I'm not familiar with Java. Is there a way to do a message box?
Views
Replies
Total Likes
If you are looking for how to do a messageBox, here it is..
xfa.host.messageBox("Text to be displayed", "Caption of the Message box",<Integer representing the icon to display in the dialog box>, <Integer representing the buttons to display>);
If you need more on what integers you can use, please goto help in your LiveCycle Designer and type MessageBox in the Index.
Hope this helps.
Thanks
Srini
Views
Replies
Total Likes
Ok, one last question, how do you represent an or condition in an if statement?
I know it's basic.
I want the message to come up if the value is <1 or greater than 3 but not when it's null.
Views
Replies
Total Likes
and operator in Java Script is "&&" and in FormCalc it is "and"
or operator in Java Script is "||" (double pipe) and in FormCalc it is "or"..
Otherway way of doing your code is:
//Execute the below statements only if the value is not null
if(this.rawValue != null){
if(this.rawValue <1) {
this.rawValue= null;
}
if(this.rawValue > 3) {
this.rawValue= null;
}
}
Thanks
Srini
Views
Replies
Total Likes
Thanks, Srini, that's what i was missing.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies