Solved

Adobe Acrobat Field Validation

Posted on 2013-11-26
7
397 Views
Last Modified: 2013-12-02
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
0
Comment
Question by:JJINFM
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39678454
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
 

Author Comment

by:JJINFM
ID: 39678686
I get an error that reads: "SyntaxError: illegal XML character 2 : at line 3"

Would you know the cause?
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39679043
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:JJINFM
ID: 39681175
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
 
LVL 18

Accepted Solution

by:
Steven Harris earned 500 total points
ID: 39681214
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
 

Author Comment

by:JJINFM
ID: 39690878
Excellent.  using cField>"" worked

Thanks for your help!
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39690892
Glad I could help!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Acrobat’s JavaScript is a great tool to extend the application, or to automate recurring tasks. There are several ways a JavaScript can be added to the application or a document (e.g. folder level scripts, validation scripts, event handling scripts,…
The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now