Copy link to clipboard
Copied
Hi,
I am trying to validate a number field. The validate range function is great, but I have two ranges that a number can fall between. I need to validate the number as being .75 or in the range from 2.25 to 6.00.
I have ZERO idea how to even start that custom validation script in Java. I've searched the community to see if there is something similar, but I am at a loss.
Any help would be appreciated. Thank you!
Scot Motzny
You can use this code to do it:
if (event.value) {
var v = Number(event.value);
if ((v==0.75 || (v>=2.25 && v<=6))==false) {
app.alert("Invalid value.");
event.rc = false;
}
}
Copy link to clipboard
Copied
You can use this code to do it:
if (event.value) {
var v = Number(event.value);
if ((v==0.75 || (v>=2.25 && v<=6))==false) {
app.alert("Invalid value.");
event.rc = false;
}
}
Copy link to clipboard
Copied
Thank you so much for your help with this. That worked perfectly!
Much appreciation!
If you have a suggestion on where I can learn how to write Java calculations and validations I would appreciate that as well. Teach me to fish!