Copy link to clipboard
Copied
Hello,
I'm trying to write a validation formula and having trouble. Hoping someone might have some ideas on how to make it work. I wrote a script and I would like the result to show unless if falls between -10 and 10. Here is what I came up with but it doesn't work.
var a = this.getField("B22").value;
if (event.value -10 <= 10)event.value=(event.value = 0);
else event.value;
Thank you in advance for any ideas on this.
Hi, you don't need var a... and else... part of the code.
if(event.value <= 10 && event.value >=-10)
event.value = 0;
Copy link to clipboard
Copied
Well, i kept playing with javascript validation and this one below i came up with is working! I thought i'd share it because it works. I'm a novice but who knows maybe someone might find it useful.
var a = this.getField("B22").value;
if ((event.value <= 10) && (event.value >= -10) ) event.value = 0;
else event.value;
Copy link to clipboard
Copied
Hi, you don't need var a... and else... part of the code.
if(event.value <= 10 && event.value >=-10)
event.value = 0;
Copy link to clipboard
Copied
I really appreciated that! I'm trying to learn and little tips mean alot. YOU ARE AWESOME to take the time to comment.
Thank you.
Steve
Copy link to clipboard
Copied
No problem, if you need help let me know 🙂