I'm going crazy. This should be the simplest thing, but for some reason I can't make it work.
I have 3 columns in a table - Min/Max/Actual Hazard Value.
The Min & Max columns are made up of 'Read Only' Numeric Fields and each contain a minimum & maximum value respectively.
The Actual Hazard Value column is a 'User Entered-Optional' Numeric Field.
I want to restrict the user to being able only to enter an 'Actual Hazard Value' that falls within the corresponding Min/Max ranges.
I've tried many things, but have ended up with the following in an Exit event in the 'Actual Hazard Value' field:
form1.firstPage.HazTbl.Haz[1].Hazh::exit - (JavaScript, client)
if(this.rawValue < Haz[1].HazMin.rawValue && this.rawValue > Haz[1].HazMax.rawValue)
xfa.host.messageBox("This h factor must be between 10 and 60. Please re-enter");
But it doesn't work.
It lets me enter any number I like.
Another way I did it was in the case of one field where the min & max were the same, so the user has to enter 100 or nothing at all. For that I tried this:
form1.firstPage.HazTbl.Haz[0].Hazh::exit - (JavaScript, client)
if(this.rawValue != 0 || this.rawValue != 100)
xfa.host.messageBox("This h factor can only be 0 or 100, please re-enter");
But that returned the message no matter what was entered.
I give up!
Can someone please assist?