How to - Template Files
The templates are located in the EZSurvey\rsrc\templates\ directory. See Web Page Appearance to use a template. This page discusses specifications of the template file.
In general,
- Symbols in {curly braces} get replaced by the appropriate value from the form options.
- [Square brackets] represent a placeholder for the question text or JavaScript code.
- <input> or <table></table> or <select></select> sequences are placeholders for the HTML form controls.
There are a few special cases to consider:
- EZSSETUP is the form that pops up to set a template's options. Some of the variables in this form may overlap with those already set by EZSurvey, such as font colors, etc.
- EZSSTART determines the where the <form> tag goes. EZSSTART is always printed first, so it should include headers and style sheets.
- EZSEND is printed last. The Previous button is positioned with [square brackets] and the Next/Submit button is positioned with the <input> tag. EZSEND should include a </form> and </body> tag, but does not need to include a </html> tag.
- A radio button or check box question is made by combining one EZSQUESTION and several EZSRESPONSE items. In EZSRESPONSE, the <input> becomes the radio button/check box, and [text in brackets] is replaced by the response text. This way, you can design a template to have the response text come above, below, left, or right of the input control. They have to come after the question text, though. The <input> tag in EZSQUESTION is deleted, but we leave it there for consistency.
- If, for any reason, a template doesn't define the right format for a question, the EZSQUESTION format is used, and this <input> tag will be needed!
- In EZSWRITEIN, the [square brackets] get replaced by question text. If it's a write-in, the <input> tag is replaced by the appropriate HTML tag (<input>)
- Similary for EZSTABLE: the <table>...</table> code gets replaced by table-wizard HTML.
- In EZSLIST, the <select></select> is replaced with the HTML form control for list boxes.
See also...