Adobe Acrobat Field Validation

Hi Experts,

I am working on an Adobe Acrobat form that has two fields.  The first is called 'Percentage' and the second is called 'Amount".

I am trying to figure out a validation rule that would allow the user to enter an amount in only one of those 2 fields.  So if there is something other than zero in the Percentage field, then they get a warning if they try to enter something in the Amount field, and vice vera.

Any suggestions are appreciated.

Thanks,

JJ
JJINFMAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Steven HarrisConnect With a Mentor PresidentCommented:
Switch over to (cField  >0), or you can also try (cField > "")

You may actually prefer the latter since you are looking for any value, not just a number greater than zero.
0
 
Steven HarrisPresidentCommented:
You may try something like:

var cField = ' other field name ';
if(cField=<0)
{
     app.alert("Please use one field only...");
     event.target.textColor = color.red;
}
else
{
     your calculation or code here
}

Open in new window

0
 
JJINFMAuthor Commented:
I get an error that reads: "SyntaxError: illegal XML character 2 : at line 3"

Would you know the cause?
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
Steven HarrisPresidentCommented:
It is probably not liking the format I am using, I am typing this freehand.  See if this errors as well:

var cField = ' other field name ';
if(cField=<0){app.alert("Please use one field only...");
event.target.textColor = color.red;}
else{your calculation or code here}

Open in new window

0
 
JJINFMAuthor Commented:
What seems to be the problem is "=<".  The editor will take "=" ,or "<", or "<=", but not "=<"

When I use "=<" I get the SyntaxError: illegal XML character 2: at line 3 message
0
 
JJINFMAuthor Commented:
Excellent.  using cField>"" worked

Thanks for your help!
0
 
Steven HarrisPresidentCommented:
Glad I could help!
0
All Courses

From novice to tech pro — start learning today.