These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Validate Percent numeric field

patra
Registered: Oct 19 2006
Posts: 270

I have a numeric field anf I'ii like to add a validation in case users enter more than 100%
I try the script below but does not work!
Any help?

Thanks

if (form1.Page1.NumericField1.rawValue <=100)
then

$.rawValue = $.rawValue;
else

xfa.host.messageBox("More than 100%. Please change the percent.");
xfa.host.setFocus($.name);
endif

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
What exactly is not working?
Where is the code located?

If it is in the validation, then you code has to return a logical true or false value to have the validation actions of LCD work.

Any error messages?
How are the percentages being computed?

You might have to compare the result to 1.00.

You could add some additional code to display the value of the field you are testing, so you will see what is going on.

George Kaiser

patra
Registered: Oct 19 2006
Posts: 270
On exit event
Percent display 12% for example