Dynamic Forms
I worked on an addition to ESIWEB that uses CMS to store data representing an HTML form, displays the form, and processes responses. Any number of forms can be stored, and generic code is used for display/processing, using the relative path of the form node to determine which form to retrieve/display.
- Used CMSUI to define node types representing a form and its related questions. The properties for the node types include information about the type of form input (radio button, text, checkbox, etc.), properties that allow the form designer to customize display aspects including spacing, color schemes, etc. and properties that allow Javascript to be added to the overall form and each individual question.
- Wrote servlet to handle retrieving nodes and properties for a specified form, putting the data into beans, and then forwarding to a JSP page for display.
- Designed JSP page to read the bean data from the request, iterate through the questions and display the contents. The JSP page uses JSTL and in-line styles, as well as Javascript for validation. The same page is used if an error is encountered when a form is submitted. The form is redisplayed with the user's previous answers pre-populated.
- Wrote servlet to handle processing of form responses. The servlet reads the user's response data from the request parameters and generates an email containing the text of each question and the response given, if any. The address to which the emails are sent is a property of the form node.

0 Comments:
Post a Comment
<< Home