Planet PDF Forum Archive

Planet PDF  ForumThe page you are viewing is part of our 160,000 page discussion forum archive. See below for PDF-related discussions spanning 1999-2008. To ask questions and get help, head to the live Planet PDF Forum.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) JavaScript


Topic: Postal Code
Conf: (P-PDF) JavaScript, Msg: 28848
From: Jub
Date: 10/20/2001 02:14 PM

Cindy,

A Regular Expression might work better for you.
In the FORMAT script try this...

event.value=util.printx(">A9A 9A9",event.value);

the '>' will force everything to upper case.
In the KEYSTROKE script try this...

if(event.willCommit && event.value)
{
/* i.e. only if something WAS entered
** and if the user is committing the value
** by tabbing, clicking away etc */

reCANZip = /[A-Za-z]\d[A-Za-z] *\d[A-Za-z]\d/;
/* this is the pattern...
** i.e. 'A+9+A+(0 or more spaces)+9+A+9' */

if(!reCANZip.test(event.value))
{
/* i.e. what the user entered does NOT
** match this pattern */

event.rc=false;
/* I always put the 'event.rc = false;'
** or 'event.value = "";' BEFORE the alert.
** Users can ESCAPE out of many of the alerts
** with Acrobat V4 (not sure if this is still
** true with V5) thus bypassing any following
** code ! */

app.a lert("Please enter Postal Code in the format A#A #A#");
/* You will need to take the space out of
** the 'a lert'...
** The forum filters out some key words
- like 'a lert' */

}
}

HTH,
Jub

PDF In-Depth Free Product Trials Ubiquitous PDF

Pitstop Pro

Now graphic arts professionals have even broader and more expert control over their PDF documents. With...

Download free demo

ARTS PDF Aerialist

The ultimate plug-in for Adobe Acrobat and #1 selling product at PDF Store. Advanced splitting, merging,...

Download free demo

Ubiquitous PDF: Free short film distribution guide released

Nigel Smith, an award-winning producer of short films, has released a free PDF guidebook to help budding filmmakers find wider audiences for their short films.

December 04, 2008
Search Planet PDF
more searching options...




PDF Resources
Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

FileOpen PDFNet SDK: PDF Component. Cross-platform PDF library

PDF Converter: Create, Convert PDF to Word/Excel Visual Integrity: Convert, Create, Extract, Merge and Modify PDF

Debenu: Desktop Document Management, Archiving and Tagging Software SmartSoft

Get Nitro PDF Professional
Featured Product

NITRO PDF Professional

Built from the ground up, the perfect desktop PDF product for business and enterprise. Nitro PDF Professional has an uncompromising feature set so you can create, combine, edit, collaborate on and...

Featured Event

No upcoming events

PDF Store Categories