Wednesday, November 12, 2008

Lessons From Adobe Livecycle Designer

Today I was using Adobe's Livecycle Designer to create a fillable PDF form.  Livecycle is Adobe's fillable form creation utility that comes as a part of Acrobat Pro.

To be honest, I think that program is cumbersome and difficult to use.

Anyway, here's some lessions learned.

1.  Try to have Adobe find the fields
Typically, you'll create your form in Word or Publisher and then import into Adobe.  If use use Adobe Acrobat Pro first, instead of Livecycle, it has a built-in find form fields features that's handy.  It will look at your form, and try to guess where the fields go.  It gets things wrong all the time., but running this first will save you time. 

2.   When working in Livecycle, save often
I've lost several forms because Livecycle died.  Save early and often to save time and effort.  My main problem were malformed javascripts.  Adobe should be able to throw an execption saying "you're scripts are screwy" instead of crashing.

3.  When adding different Radio Button Groups.
Creating one group is easy.  The second is where it gets hard.  The easiest way I found to cre
ate seperate radio button groups (a group is
 a collection of radio buttons that are mutually exclusive, turning on one, turns the others off) is 
  1. Drag the new radio button to the form
  2. right click on the button 
  3. Click on "Wrap in New Radio Button Group" (see figure)
  4. You're done
Validation
There are times you would like to advise your users that the values they entered are inccrrect.  There are really good reasons to do so.

First, you put a form out to collect data from users.   If they have made a mistake, they will be able to correct it and put the correct information into the form.  Once the form is received, all you can do is guess or attempt to contact the user for clairfication.  It makes sense to do the editing before you receive the form.  Second, there are some values that are simply wrong.  A data of 2/30/xxxx is always wrong.  If they entered this date, did they mean 1/30 or 3/30?

Be careful with edits, though.  You must allow for unknown values, even if it doesn't make sense to you (for example, on gender), but its better than making the user lie in order to submit the form.


To do edits, place the validation code into the validation script in livecyle.  Below are two examples of validation code.

Livecycle desginer 8
//Validate days in the month based upon month(1 <= this.rawValue && this.rawValue <=29 && MonthField.rawValue ==2) || (1 <= this.rawValue
 &&
 this.rawValue <=30 && (MonthField.rawValue ==4 || MonthField.rawValue ==6 || MonthField.rawValue ==9 || MonthField.rawValue ==11)) || (1 <= this.rawValue && this.rawValue <=31 && (MonthField.rawValue ==1 || MonthField.rawValue ==3 || MonthField.rawValue ==7 || MonthField.rawValue ==8 || MonthField.rawValue ==10 || MonthField.rawValue ==12));
 
 
//Validate the year
var dt = new Date();
var cyr = dt.getFullYear();
1917 <= this.rawValue && this.rawValue <=parseInt(cyr);
Creating Radio Button Groups
 

No comments: