Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Exclude Negative Numbers?

10000Forms_
Level 1
Level 1

Is there a way to exclude negative numbers from appearing in numerical (currency) fields?

For instance, if a user were to attempt to enter a negative number in a given field, is there a way to instruct Adobe to erase the entry, or better yet, to prevent the user from doing so?

Thanking you in advance.

1 Accepted Solution
pranavj326318
Correct answer by
Employee
Employee

Hi Susan,

If you are using LC Designer, please use the following script on the exit event of the numeric field in the script editor box

 

if(NumericField1.rawValue<0)

{

NumericField1.rawValue="";

xfa.host.messageBox("Please Enter the positive value");

xfa.host.setFocus(NumericField1);

}

Let me know if that works,

View solution in original post

6 Replies
pranavj326318
Correct answer by
Employee
Employee

Hi Susan,

If you are using LC Designer, please use the following script on the exit event of the numeric field in the script editor box

 

if(NumericField1.rawValue<0)

{

NumericField1.rawValue="";

xfa.host.messageBox("Please Enter the positive value");

xfa.host.setFocus(NumericField1);

}

Let me know if that works,

View solution in original post

41globalit
Level 2
Level 2

Would I be able to possibly use similar function to ignore a drop down field that contains N/A?  Have 8 dropdowns that cotain "N/a, 1, 2, 3" and are all averaged out at the end but need N/A to be ignored if chosen??

Thanks so much n advnace for any help

pranavj326318
Employee
Employee

Hi 41globalit,

Please look into the example 2 attached in the sample file

~Pranav

41globalit
Level 2
Level 2

This looks like exactly what I am looking for!! Will have to do some small tweaking I think to fit into my file!  Thanks so much!

41globalit
Level 2
Level 2

Im not expert on coding.  What coding would I need to change?  All drop downs named DropDownList1, DropDownList2, DropDownList3, etc....

here is link to pdf if you'd like to view

http://41global.com/performeval.pdf

Thanks so much,

Message was edited by: 41globalit

Message was edited by: 41globalit

41globalit
Level 2
Level 2

For example 2 in your pdf, what would be the script i'd need to get things to average instead of it doing sum total??