Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Form Guide (Convert PDF Form to Form Guide)

Avatar

Former Community Member
Hello,



I am a fresh on Form Guide and I would like to know more about it. First of all, i tried to conver my PDF Form into Form Guide. However, i found that most of the javascript didn't work on Form Guide. As I know, the scripting of Flex is action script and the scripting of the form is javascript (i used).



1. How is the standard process to convert my production form with scripting into form guide?

2. Any more sample with full story for converting the pdf form to form guide?

3. I need a Flex Builder-add on to edit the form guide?



Benjamin
7 Replies

Avatar

Former Community Member
The Form Guide is meant to work in conjunction with a PDF not convert from it. It giver users an alternate interface to collect the data but in most cases the PDF is still required. Think of the Guide as a wizard that sits on top of the form. Ultimately the form is still required.



The Guide can only be used if the form is served up from LiveCycle Forms. For this reason all of the samples are included with the Forms product.The tool to build guides is included with the Form Designer (Tools/Create or Edit Form Guide).



The guide makes use of the template file and the script that is coded into the form. A subset of the XFA Object model has benn built into the guide and a number of javascript functions have been implemented so that the designer does not have to work with Action Script. This is meant for Designers who are not that aware of Flex.

Avatar

Former Community Member
Thanks for your reply. Yes, form guide is the conjunction with PDF.



I created a simple LC Form with 2 textfields and add a line javascript in the exit event of textfieldA to copy the rawvalue into textfieldB.

textfieldsB = this.rawvalue;



This line of script works well in the ES Form. However, it is not work in the Form Guide.



Are there any limitation of the javascript to be worked on the form guide?



Actually, my production ES forms have alot javascript to do some hide/show of panels/textfields. What is the standard way for me to code my form with using form guide?

Avatar

Former Community Member
In preview of Guide Builder, there are some errors displayed. The following is one of it:

Any suggestion for me to solve it?



**********************************************************************

this.emailAdd = function(fldName)

{

with (this) {

var objField = xfa.resolveNode(fldName);

var fldValue = objField.rawValue; <-Error

**********************************************************************



Error: Syntax error: expecting identifier before div



According to the document "Scripting Support for HTML Forms and Form Guides", xfa.ResolveNode is supported in form guides.

Avatar

Former Community Member
Ok now I see the issue .... The "this" object is a Javascript implementation of the object that has focus .....it is not a supported obejct in the guide. If you change that to the objects name then it should work. Not sure what the emailAdd method is or the "with" keyword. I have not seen those before and they are not described in my Javascript guide.

Avatar

Former Community Member
Thanks. I found out that the syntax error cased by the regular expression. Once i adjust the regular express as below:

From:

var regExp = /^([a-zA-Z0-9_\.\-\/#\$%'\?@+])+\@(([a-zA-Z0-9_\.\-\/#\$%'\?@+])+\.)+([a-zA-Z0-9_\.\-\/#\$%'\?@+])+$/;



To:

var regExp = new RegExp("^([a-zA-Z0-9_\.\-\/#\$%'\?@+])+\@(([a-zA-Z0-9_\.\-\/#\$%'\?@+])+\.)+([a-zA-Z0-9_\.\-\/#\$%'\?@+])+$");



The syntax error was disappear and can preview the guide.

However, i am facing another problem now.

The change event of the textfield (Address) works well in PDF Form. The code as below:

**************************************************************

form1.Page1.Address::change - (JavaScript, client)

app.alert(xfa.event.change);

**************************************************************



However, the change event cannot be fire on Form Guide. Moverover, once exit the textfield, the following error throw out:

**************************************************************

script execution error : form1[0].Page1[0].Address[0]:change

ReferenceError: Error #1069: Property change not found on xfamx.scripting.EventNode and there is no default value.

.

.

.

**************************************************************

any ideas?

Avatar

Former Community Member
That is because app.alert is an Acrobat command and cannot be used in a Guide. Change it to xfa.host.messageBox(xfa.event.change) and it will work fine in both environments.

Avatar

Former Community Member
Thanks for your suggestion. However, xfa.host.messageBox(xfa.event.change) is not trigger on the guide (textfield's change event) also.

And i found that the textfield exit event will be trigger in the guide when going to other panel sometimes...any ways to avoid it?