“Low” security settings to expire a form

This example demonstrates how you can hardwire a date into a form, so that the form will not display after that date. This is not a high security method and a user with a reasonable knowledge of XFA forms would be able to negate these measures. Download: Assure Dynamics Security page visible after set date

Read more

Accessing bound and display values of dropdowns

This example shows how you can use different scripting techniques to access the bound and display values of a dropdown. My personal favourite is option 2. Download: Assure Dynamics Accessing bound and display values of dropdowns (Rev 1)

Read more

Accessing PDF menu items

This example provides the script necessary to access Acrobat/Reader menu items. When you click a button a dialog appears where you can test the menu or copy the script. Download: Assure Dynamics PDF Menu Items

Read more

Accessing PDFs from within a form

Occasionally you may want a form user to have access to supporting documents, as they are completing your form. One solution is to open the form in Acrobat and to attach the document to the form. This is relatively straightforward, but may make it difficult to maintain the document, once the PDF is deployed. Another [...]

Read more

Building dynamic tables

This example works through the steps in building a dynamic table. It includes screen shots and scripts that are necessary. It also shows how to organise your objects into flowed and positioned subforms. Download: Assure Dynamics Building dynamic tables

Read more

Buttons

This example examines different design approaches for buttons in LC Designer. You can explore these options and copy the different buttons into your forms. Download: Assure Dynamics Buttons

Read more

Changing an objects presence and relevant properties

This example demonstrates how you can script to change an object’s presence and relevant properties. While you can set these in the Object > Field palette, you may need to changes these values at runtime. Download: Assure Dynamics Changing the objects presence

Read more

Changing the display pattern

A previous example looked at scripting options to change the locale at runtime. This example extends this approach and demonstrates how you can change the display pattern at runtime. Download: Assure Dynamics Changing the display pattern at runtime

Read more

Changing the highlight colour behaviour

This solution explores ways in which you can change how the fields on your forms are highlighted. You can force the highlight to be on or off. In addition you can change the colour of the highlight. Download: Assure Dynamics Highlight colour behaviour

Read more

Changing the locale at runtime

This example changes the locale of objects in the form. For example you can change the locale for the date, quantity and cost fields. The first page targets specific fields, whereas the second page uses a function to change the locale of all fields on page 2. Download: Assure Dynamics Changing Locale

Read more

Changing the mandatory property

This example changes objects from being mandatory to optional, depending on their presence. This avoids a problem where a hidden object is required, which will prevent a user from being able to complete the submission. Download: Assure Dynamics Mandatory Property

Read more

Changing the visual appearance of checkboxes and radio buttons

This first example includes three sets of scripts, to change the visual appearance of checkboxes and radio buttons. You can mix and match these solutions to suit your requirements. The second example was added in October, to provide a more efficient way of dealing with radio buttons. The script is generic and can be dropped [...]

Read more

Checking for null values prePrint

This example provides a generic solution that loops through a page and if all of the objects are null, then it will not print that page. If any of the objects have a value, then the page will be printed. Again, this demonstrates the advantages of using a function (in a script object), which contains the main [...]

Read more

Concatenating and floating fields

This sample form demonstrates two separate approaches for compiling different object values into one field. Using script in the calculate event, either using the FormCalc Concat() function or JavaScript. Using floating fields. The third example also uses floating fields, but additional script in the docReady event and the enter event of the associated textfields, allow [...]

Read more

Custom dropdown lists

This example shows how you can set up a standard dropdown list to allow searching and filtering of the items. The technique requires two small changes to the standard dropdown. Set the dropdown to allow custom text entry. Include a short script in the enter event of the dropdown, to open the list when the [...]

Read more

Deploying forms in Acrobat and Reader

This is a summary of deployment options before you send your form out. Download: Assure Dynamics LiveCycle Forms in Acrobat and Reader

Read more

Detecting key presses

This example demonstrates how you can detect if the user is pressing certain keys. For example the Control key or the Shift key. In addition you can detect how the user has committed a value to a field. These methods can be used to react to the users actions. Check out the examples in the [...]

Read more

Duplicating table data

This example looks at two options for removing null rows before printing. The first uses the presence property, whereas the second duplicates the non-null rows to a new table. Download: Assure Dynamics Duplicate table data if not null

Read more

Expanding objects in flowed subforms

This example demonstrates how to group dynamic objects in flowed subforms and objects that do not grow inside positioned subforms. Download: Assure Dynamics Expanding objects in flowed subforms

Read more

Expanding textfields maintaining horizontal position

This example shows you how to set up expanding textfields that will maintain their relative horizontal/x position, as they expand onto a new page. While you would normally place expanding objects in a Flowed subform, in this case you wrap the textfields in a Positioned subform, but set its height to Auto-fit. An alternative would [...]

Read more

Explore the differences between positioned and flowed

This example just looks at how objects behave when in a positioned or flowed subform. The subform type indicates how the objects inside it will behave. Download: Assure Dynamics Positioned v Flowed Subforms

Read more

Exploring master pages and content areas

This example shows the importance of setting up the master page(s) and content area(s) correctly. If includes screen shots highlighting the key areas that you need to be familiar with. Download: Assure Dynamics Master Page and Content Area

Read more

Extending an addInstance Script

This example extends an addInstance script, to allow the user select which of the existing rows they want to copy into the new instance. Download: Assure Dynamics Extending addInstance

Read more

Form Validation

Here is another example for form validation. We are using a function to loop through all of the form objects and to take appropriate action if a mandatory field is not completed. While this version of the example is targeting Acrobat/Reader version 8.1, it also uses the propagate event, which is not actually available in [...]

Read more

Form variables

John Brinkman describes form variables in his post, covering all of the various options: Creating variables in the File > Form Properties > Variables tab. Creating a form variable in JavaScript. I wanted to explore a use case where form variables associated with a particular field would be useful. As an example here is a form where [...]

Read more

Hiding null objects

This example uses a function in a script object to work through the form and set the presence of null objects to hidden. The example also demonstrates the difference between positioned and flowed subforms, as the objects are hidden. Download: Assure Dynamics Hiding null objects

Read more

Image hotspots

This example uses buttons with no fill, to act as hotspots over an image. Download: Assure Dynamics Hotspots over image

Read more

Laying out form objects

This example highlights some of the main considerations when placing objects in a form. Page 2 includes some bonus scripts for changing the visual appearance of the objects, as the user interacts with the form. Download: Assure Dynamics Layout Form Objects (Rev 1)

Read more

Limiting the number of characters in a field

This example looks at two possible ways to limit the number of characters in a field. The first uses standard settings in the Object > Field palette. Whereas the second using scripting in the exit event of the field. Download: Assure Dynamics Limiting input to set character length

Read more

Limiting the number of checkboxes that can be ticked

This example limits the user to ticking a maximum of two checkboxes out of any of the five available. The script tracks the value of the five checkboxes (1/0) and if this is equal to 2, then it sets the access property of the checkboxes to readOnly. Download: Assure Dynamics Keeping track of checkboxes ticked

Read more

Linking dropdowns using global binding

This example looks at how you can link dropdown using global binding, the display items and the bound items. Quick and simple, with no scripting. Download: Assure Dynamics Linked dropdown lists

Read more

LiveCycle Designer ES2 script events

This is a great tool for exploring how and when events fire. Download: Assure Dynamics LiveCycle Designer Script Events

Read more

Lock all fields

This is an adaptation of Paul Guerette’s great solution for locking all fields on a form. We have tweaked the function to look out for button objects by checking the ui.oneOfChild.className of the current object. In addition we have include some security aspects of this earlier solution. Thanks to Jono for spotting an error in [...]

Read more

Looping through images

This example sets out two approaches to changing the current image being displayed in an ImageField object. There is a single button on page 1 (script is in the click event), whereas there nine buttons on page 2 (script is in the mouseEnter event). Download: Assure Dynamics Looping through Images

Read more

Looping through repeating rows

This example demonstrates how to set up a loop to look at each row in a repeating table. Have a look at the script in the exit event of the Quantity field. This looks at the VAT code on each row and completes the VAT analysis for all of the selected items in the table. [...]

Read more

Lottery Ticket Checker

We received a request for a lottery ticket checker and this is the resulting example. Please note that we do not warrant the use of the form for checking of actual lottery results. The example shows how you can set up generic functions to look at data that is inputted into the form. For example, to limit [...]

Read more

Making fields dynamic

This example shows how to set up fields that change as the user interacts with your form. Download: Assure Dynamics Making fields dynamic (Rev 2)

Read more

Mimicking exclusion groups in tables

This example uses a checkbox in table rows, to act like a radio button exclusion group. Download: Assure Dynamics Mimicking exclusion group in table

Read more

Moving objects around a form

This example allows a user to click on an object and move it to a new location. Download: Assure Dynamics Moving objects in XFA form

Read more

Null patterns for text fields and other objects

This example demonstrates a number of different applications for null patterns in form objects. This is where a field without a inputted value can display a default message. Note that having the full caption in the value area is not best practice. This is because as soon as the user clicks into the field the null pattern [...]

Read more

Populating dropdowns

This example shows how to use the preOpen event in a dropdown. This is the ideal event to use when dynamically setting the items that are available in the dropdown list. The script can be set to look at the values of other objects in the form and then populate the dropdown list based on these values. [...]

Read more

Populating dynamic tables

This example demonstrates one method to populate repeating rows in a dynamic table. The user selects a choice from a dropdown and related data is inserted into the table. I have update this example, so that the uppermost row does not have an Up button. Similarly the last row does not have a Down button. Download: Assure [...]

Read more

Popup index for sections within form

This example demonstrates the popup method, which can be used to display an index of sections with your form. The user can select a page and the script jumps to that section. Download: Assure Dynamics Index (variable number of pages)

Read more

Print if form passes validation

This example uses the validationState event and the cancelAction property so requires Acrobat/Reader v9 or above. Download: Assure Dynamics Print if validation passes

Read more

Referencing objects

This example shows how to reference objects in script. When in the script editor, a great tip is to press Control while you click on an object you want to reference. LC Designer will automatically insert the reference for you. You can read all about SOM expressions here and explore the example provided. Download: Assure [...]

Read more

Resetting fields

This example looks at some options for resettings fields. In particular the use of different objects. The preferred option would be to use a button as this is clearer for the user. Download: Assure Dynamics Resetting fields

Read more

Resetting Rich Text Fields

A problem exists in earlier versions of Acrobat/Reader when using rich text fields within an XFA Form. If the user deletes text from a rich text field; saves the form; and then closes it; when they reopen the form the original text will be restored to the rich text field. This is obviously not ideal [...]

Read more

Scaling images

A previous example used images to demonstrate the difference between Positioned and Flowed subforms. This example accesses the current width and height of the image and either increases or reduces this, depending on which button the user clicked. The image will not break over a page and will flow onto a new one. You can [...]

Read more

Scoring dropdowns

There are a couple of examples that are related to this one. First this example shows how to use the display value and the bound value of a dropdown. The second demonstrates how you can use the global binding. This example below, shows how you can then add the value of the dropdown and summarise [...]

Read more

Scoring three options

This example looks at script to keep track of scores. CDownload: Assure Dynamics Scoring three options

Read more

Script to change the focus

This example demonstrates that script can be developed to change the focus of the current field based on events. While this can be achieved using fairly straightforward script, it is probably not the best approach. This is because the user may not be aware that the focus has changed, whilst in the process of inputting [...]

Read more

Scripting a null display pattern for a dropdown

It is relatively straightforward to set a null display pattern for a textfield or numericfield – you just go to the Object > Field palette, click Patterns and allow empty. However dropdowns just have validate patterns, so one solution is to script a display pattern. Download: Assure Dynamics Null display pattern for dropdown (Rev 1)

Read more

Showing and hiding pages

This example demonstrates the presence property. Objects can be set to ‘visible’ and ‘hidden’. The hidden value has an advantage over ‘invisible’, as it excludes the object from the form, thus allowing other objects to take its space. This requires the form to be saved as a Dynamic XML form. Download: Assure Dynamics Show and [...]

Read more

Showing and hiding pages with a loop

Our previous example used a dropdown to control which page was visible. In this example we show how you can set up a loop in a function to hide all of the pages and then allow the remainder of the script to show the target page. This may be useful where you have a lot [...]

Read more

SOM Expressions

This is a dynamic demonstration of SOM expressions. There is a full description here. Download: Assure Dynamics SOM Expressions (v4)

Read more

Splitting an object’s rawValue into an array

This example demonstrates how you can specify values for an object (in this case a dropdown) and then subsequently split the rawValue into an array. The script is generic and can handle specified values with different number of variables. Please review the Object > Binding palette to see the format of the specified values for the dropdown. [...]

Read more

Tabbing order

The final tabbing order, to a large extent, is affected by the relative x/y coordinates of objects. This example explores tabbing issues. Download: Assure Dynamics Tabbing Order

Read more

Tables and sections

You can group rows into sections within a table. This example explores some of the common scripting tasks when dealing with tables and sections. Download: Assure Dynamics Tables and Sections

Read more

Tracking interaction

This example tracks when the user ticks checkboxes on different pages of the form. Download: Assure Dynamics Tracking checkboxes on different pages

Read more

Two column layout

In a previous example we look at situations where you may want to have columns of text that keep their relative position on the page, as they overflow onto a new page. See here. In this example we have a flowed page layout with two content areas on the Master Page (column1 on the left [...]

Read more

Two way binding in tables

This example provides an advanced solution to two way binding in dynamic tables. In this scenario global binding will not work, so a scripted solution is necessary. Download: Assure Dynamics Tables displaying same information (exit event)

Read more

Using a function to change visual appearance

A previous example showed how you can use script to change the visual appearance of an object. This example extends that principle and shows how you can set up a function, which can control the visual appearance of all objects. This makes it easier to maintain the form and make your script more reusable. Download: [...]

Read more

Using hash keys to lock objects

This solution is based on Dimosthenis Theodoridis’s article on Generating and working with hashes in dynamic PDF forms. Once a user clicks the unlock button and enters a valid password, specific fields become available. The user can then enter information into these fields. To re-lock the fields, the user clicks the button again, but this time [...]

Read more

Validating on the preSave event

This example fires the execValidate() on the preSave event. If required fields are null, then a warning is displayed. Note that for this example we have not used some of the new features, such as validationState event or the cancelAction method. Therefore it should work satisfactorily in earlier versions of Acrobat/Reader. Download: Assure Dynamics Validate [...]

Read more

Working with images

This example shows how you can work with images in your form. The first page includes five Image objects where the photographs are embedded into each of the Image objects. This increases the size of the form unnecessarily. You should only embed images, where you want the image to be available to other developers opening [...]

Read more

Zoom settings

This example looks at script to control the zoom of the form when it is opened. You can copy any of the settings into the docReady event of the root node. I am sticking this one in “images” for the hell of it Download: Assure Dynamics Zoom settings

Read more