“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 moreAccessing 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 moreAccessing 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 moreAccessing 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 moreBuilding 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 moreChanging 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 moreChanging 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 moreChanging 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 moreChanging 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 moreChanging 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 moreChanging 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 moreCheck if form is signed before emailing
This example shows you how to set up a fake email button that first checks to see if the user has signed the signature field. If the form is signed, then the script fires the click event of a hidden email button. If it is not signed, then a popup windows provides additional instruction to [...]
Read moreChecking 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 moreConcatenating 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 moreCustom 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 moreDeploying 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 moreDetecting 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 moreDuplicating 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 moreEmail script (v9 and above)
This example uses the new ValidationState event and the cancelAction property. It needs Acrobat/Reader v9 or above. Download: Assure Dynamics Email Buttons (v9 only validateState event)
Read moreEmail script (v9 and below)
This example will work in earlier versions of Acrobat/Reader. Download: Assure Dynamics Email Buttons (v9 or below)
Read moreExpanding 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 moreExpanding 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 moreExplore 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 moreExploring 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 moreExtending 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 moreForm 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 moreForm 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 moreHiding 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 moreImage hotspots
This example uses buttons with no fill, to act as hotspots over an image. Download: Assure Dynamics Hotspots over image
Read moreLaying 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 moreLimiting 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 moreLimiting 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 moreLinking 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 moreLiveCycle Designer ES2 script events
This is a great tool for exploring how and when events fire. Download: Assure Dynamics LiveCycle Designer Script Events
Read moreLock 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 moreLooping 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 moreLooping 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 moreLottery 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 moreMaking 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 moreMimicking 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 moreMoving 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 moreNull 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 morePopulating 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 morePopulating 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 morePopup 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 morePrint 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 moreReferencing 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 moreResetting 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 moreResetting 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 moreScaling 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 moreScoring 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 moreScoring three options
This example looks at script to keep track of scores. CDownload: Assure Dynamics Scoring three options
Read moreScript 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 moreScripting 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 moreShowing 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 moreShowing 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 moreSOM Expressions
This is a dynamic demonstration of SOM expressions. There is a full description here. Download: Assure Dynamics SOM Expressions (v4)
Read moreSplitting 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 moreTabbing 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 moreTables 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 moreTracking interaction
This example tracks when the user ticks checkboxes on different pages of the form. Download: Assure Dynamics Tracking checkboxes on different pages
Read moreTwo 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 moreTwo 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 moreUsing 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 moreUsing 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 moreValidating 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 moreWorking 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 moreZoom 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