If statement before correcting for percentage
Hi,
I have a field (SCharge1) in which clients specify the sales charge (0-3%) applied. I would like to check to make sure that the amount entered is between 0 and 3 however, I have modified the percentage format as to divide the amount entered by 100 so that clients can enter 1 and it equals 1% so that clients do not get confused when filling out the form. I have done this by running a custom validation script:
if (event.value !== "") {
event.value = event.value / 100 ;
}
I was wondering if there was a way to check to make sure the field is between 0-3 and if not creating an error message to modify the field? I am unsure whether to run the check before or after the validation script and whether to combine the scripts or add a separate option. This is what I tried to check the sales charge after but to no avail:
(function () {
var v = getField("SCharge1");
if(v >0.03){
var resp = app.alert({cMsg: "Fund Code does not match the Fund Class selected, please revise.", nIcon:0});
}}
)
Any help would be much appreciated!
