THESE FORUMS NOW CLOSED (read only)

Fun Stuff => CLIKC => Topic started by: Elysiana on 22 Mar 2011, 08:18

Title: Limit characters in a PDF form?
Post by: Elysiana on 22 Mar 2011, 08:18
I am making a fillable PDF form and two of the fields need to be alphanumeric only. Apparently people don't understand "alphanumeric" or "A-Z 0-9 ONLY" so I'd love to just make it so that they can't possibly put anything other than those characters in the field. I'm not really sure how to look this up; I've done a few searches with no luck and I don't know if it's not possible or I'm just not searching for the right terms. The Acrobat forums had something about setting it up for just alpha but they didn't explain how to do it (something about adding JavaScript but I have no idea how you even do that). I'm like a lost puppy!

(I hope I'm asking in the right spot; it's not game-related but it's program-related.)
Title: Re: Limit characters in a PDF form?
Post by: pwhodges on 22 Mar 2011, 08:50
Is this (http://forums.adobe.com/thread/782111?tstart=-1) helpful, or do you need more?
Title: Re: Limit characters in a PDF form?
Post by: Elysiana on 22 Mar 2011, 09:23
I'm almost positive that's what I'm looking for, but I have no idea where to put that info. I've been searching through LiveCycle's help files and I'm finding stuff about validation but when I try to enter that script it says it's invalid so I must be in the wrong place.

I'd rather not sign up for Adobe's forums since I have a swiped copy, but I may have to.
Title: Re: Limit characters in a PDF form?
Post by: pwhodges on 22 Mar 2011, 10:21
You are using Acrobat to generate the form, right?  I'll link to my work machine (where I have a copy) later this evening and try to work it out.
Title: Re: Limit characters in a PDF form?
Post by: Elysiana on 22 Mar 2011, 11:14
Using Adobe LiveCycle Designer, actually (which I guess is built into Acrobat, so yes).

You're awesome, thank you!
Title: Re: Limit characters in a PDF form?
Post by: pwhodges on 22 Mar 2011, 16:25
Wow, that was hard to find.  You know how some things are just hard to Google because the search terms are so common, and others are hard to find because everything on the entire Internet  starts with the presumption of some knowledge you don't have?  Well, this fell into both categories; even though I had a copy of Acrobat Pro and its help open as well!  You can also tell that Forms in Acrobat is something I've never done before.

Here's the deal (and you probably won't like it): custom validation is not available with LiveCycle forms, only with AcroForms.

Did you know there were two completely different incompatible types of form in there?  I didn't.

You don't "create" an AcroForm.  You create a vanilla PDF document, and you add form fields to it.  The easiest way is to enable the Forms toolbar (View | Toolbars | Forms); then you click on an icon to select, say, the text input tool, and then double click with that tool in the document where you want that field.  Right-click the field and select properties; when they appear, select the Validate tab, and you will see a box (enabled by a radio button) where you can put the custom validation script (cut and paste from the page I first linked you to).

Good luck!
Title: Re: Limit characters in a PDF form?
Post by: Barmymoo on 22 Mar 2011, 16:29
If all else fails, you could put "Use letters (a b c) and numbers (1 2 3) only", which might be more clear than "alphanumeric".
Title: Re: Limit characters in a PDF form?
Post by: Elysiana on 22 Mar 2011, 20:18
Thank you so much for looking into that! Glad to know it wasn't just me having trouble finding answers - you're right about them assuming you have some prior knowledge of what to do. I guess I just need to look into putting a newer version of Acrobat on my computer. In the meantime, I may just have to suck it up and change the ones that are done wrong.


I don't have a lot of room to put the instructions for that field, and to be honest, people don't seem to be reading ANY of the instructions on the form. I thought "A-Z 0-9 only" would clear it up because maybe "alphanumeric" was just something they weren't familiar with, but apparently that didn't help either. grrr
Title: Re: Limit characters in a PDF form?
Post by: celticgeek on 22 Mar 2011, 20:29
There is a general rule for that:  "If all else fails, read the instructions."  Applies to almost everybody. 
Title: Re: Limit characters in a PDF form?
Post by: mberan42 on 22 Mar 2011, 20:54
@ celticgeek tl;dr: RTFM
Title: Re: Limit characters in a PDF form?
Post by: pwhodges on 23 Mar 2011, 00:27
I guess I just need to look into putting a newer version of Acrobat on my computer. In the meantime, I may just have to suck it up and change the ones that are done wrong.

It's not a matter of version - AcroForms is the original, and at Acrobat 7 they added LiveCycle Editor to the package as a fully-functional and integrated demo of the alternative because of its other properties; however, it simply lacks the functionality you want.  So your choice is to do without the validation or to throw the form you've made away and start again using the older technology which maybe works for you.
Title: Re: Limit characters in a PDF form?
Post by: Elysiana on 23 Mar 2011, 05:27
Ohhh gotcha. Wait... so they removed some functionality for the handy little editor they added that was supposed to make everyone's lives easier? Go team.

Considering they have a handy little button that you can click to change a regular field into a numbers-only field, you'd think they'd have one for this.

Oh well. Thank you again, I really appreciate it!
Title: Re: Limit characters in a PDF form?
Post by: pwhodges on 23 Mar 2011, 06:48
LiveCycle is a separate product; and the form designer was sort-of shoehorned into Acrobat and the PDF format, presumably to try to pull in users to the whole LiveCycle suite.  LiveCycle has some nice features that AcroForms don't offer, but also misses some features as we have just seen.  If you are not using any of the LiveCycle form features, then redoing your form in "pure" Acrobat is your way forward.
Title: Re: Limit characters in a PDF form?
Post by: snalin on 23 Mar 2011, 15:59
and others are hard to find because everything on the entire Internet  starts with the presumption of some knowledge you don't have? 

Or it starts with the presumption that you know nothing at all.

The first semester of programming was such a bitch since every tutorial either went from "this is how you create a "hello world" app" and outwards from that, or started with the presumption that you have been working in the field for three years and are looking for something that's more specific than the api. Same problem with both php/html and with bash scrips.