If statement before correcting for percentage


hi,

 

i have field (scharge1) in clients specify sales charge (0-3%) applied. check make sure amount entered between 0 , 3 however, have modified percentage format divide amount entered 100 clients can enter 1 , equals 1% clients not confused when filling out form. have done running custom validation script:

 

if (event.value !== "") {

event.value = event.value / 100 ;

}

 

i wondering if there way check make sure field between 0-3 , if not creating error message modify field?  unsure whether run check before or after validation script , whether combine scripts or add separate option. tried check sales charge after no avail:

 

(function () {

 

  

    var v = getfield("scharge1");

 

   if(v >0.03){

   var resp = app.alert({cmsg: "fund code not match fund class selected, please revise.", nicon:0});

}}

)

 

any appreciated!



More discussions in Coding Corner


adobe

Comments

Popular posts from this blog

Soustraire une selection

After Effects: could not find dvaeve_dialogs.txt

Illustrator cs6 "Invalid Serial Number"