LiveCycle Designer JavaScript Example

Use Regex To Convert Date Format

April 12th, 2011

This is a simple little example of how to use a JavaScript Regular Expression in Adobe LiveCycle Designer to change the format of a date in code. You can just copy and paste the code below into designer to try it out.

———————————————-

/**
Adobe LiveCycle Designer JavaScript
How a date in from YYYY-MM-DD format to DD/MM/YYYY in code.
**/

var re = /^(\d{4})\-(\d{2})\-(\d{2})$/;

var origDate = “2011-04-12″;

var newDate = origDate.replace(re, “$2/$3/$1″);
app.alert(“newDate = ” + newDate);

var matchArray = origDate.match(re);
app.alert(“matchArray = ” + matchArray);

/**
Now you have a variable (newDate) containing (12/04/2011) and an array (natchArray) containing (2011-04-12,2011,04,12).
**/

———————————————-

Rod Swift

PDF Form Developer

SwiftForms

http://swiftforms.com.au

 

LiveCycle Form

March 29th, 2011

Dynamic, Intuitive, Accessible PDF Form Designer

March 29rd, 2011

Guidelines Topics Followed by SwiftForms™

  • Usability guidelines for online application forms
  • Overall customer experience
  • Make it easy for users to find the form
  • Create a good first impression
  • Encourage user trust
  • Encourage user interest and feedback
  • Create a flexible design which will support the needs of different users
  • Moving around the form (navigation, workflow & orientation)
  • Make it easy for users to understand the workflow and structure of the form
  • Make it easy for users to identify next steps (links and buttons)
  • Provide efficient navigation within the form
  • Provide users with a quick, efficient workflow
  • Reading the form (written content & language)
  • Style of language
  • Grouping of information
  • Make it easy to complete the content
  • Viewing the form (layout & presentation)
  • Page layout
  • Use of images
  • Readability
  • Accessibility
  • Appropriate use of colour
  • Interaction design
  • Error handling
  • Standards and other sources of information
  • Best Practice Checklists
  • Content
  • Form performance
  • Interaction design
  • Visual design

SwiftForms™