Adding custom fields to trouble ticket mail form.The script allows addition of virtually unlimited number of custom fields to your mail forms. The rule is plain simple - any new ticket form input (see the newticket.html template) with a name starting with letter 'x' is considered to be a custom field. The help desk software will automatically add its name and content to the trouble ticket message. Here is how you may add 2 custom fields - Phone and Department. Just add this to your newticket.html template: <tr> <td align=right class=lbl>Phone</td> <td align=left><input type=text size=25 name=xPhone value="(%INPUT_xPhone%)"></td> </tr> <tr> <td align=right class=lbl>Department</td> <td align=left> <select name=xDepartment> <option></option> <option>Sales</option> <option>Service</option> <option>Billing</option> </select> </td> </tr> <script type="text/javascript"><!-- var i; for (i = 0; i < document.forms['newticket'].xDepartment.options.length; i++) { if (document.forms['newticket'].xDepartment.options[i].text == '(%INPUT_xDepartment%)') { document.forms['newticket'].xDepartment.options[i].selected = true; } } //--></script>Note the (%INPUT_xPhone%) macro and JavaScript code used to initialize custom fields. This is how your web form preserves content of the fields in an event of submission errors (e.g. missing email address or customer name). Note: The Trouble Ticket Express as of version 2.20 supports page caching. The feature may prevent you from seeing modified templates immediately. We recommend disabling page caching while working on templates design. To disable page caching please edit configuration file, you need to assign 0 (zero) to the usecache variable (default value is 1). Marking custom fields as mandatory. (Note: the feature requires rel.2.10 or newer). In order to mark any or all custom fields as mandatory use a 'mandatory' input in your form. Value of the input must contain a list of all the custom fields, what may not be left blank. Example: <input type=hidden name=mandatory value="xPhone,xDepartment">You may also define multiple 'mandatory' inputs: <input type=hidden name=mandatory value=xPhone> <input type=hidden name=mandatory value=xDepartment>The later approach allows assigning mandatory status dynamically, for example: <input type=checkbox name=mandatory value="xPhone"> Please call me back. Accessing custom fields. The Trouble Ticket Express through However, using optional Layout Designer module you may store values of up to 10 custom fields in the index file. These custom fields may be set as ticket browser colum headers and search criterias. |