iService forms will automatically create the HTML necessary for the form based on the form body commands and parameters used. You can customize any of the input commands using the -customhtml parameter. The -customhtml can be inserted anyplace inside the $Input command.
Various examples of using the -customhtml parameter are shown below. When using -customhtml, the custom HTML markup should reference the $Input ID of the element being modified using the "name" parameter.
iService forms will automatically generate an HTML drop down list (select statement) for any contact or interaction properties that are based upon lists (i.e., an Additional Detail). However, you can convert any $Input field into a drop down list and specify the selections using the -customhtml parameter.
Year: $input -id'year' -required -customhtml$
<select name="year">
<option value="">--select a type--</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
</select>
In this example, the ID of the input field is "year" and the HTML select command is used generate a drop down list. Within the HTML code use the "name" parameter to specify the iService $Input command that is being modified. In this example, we used <select name="year"> within the custom HTML to indicate the input is going into the iService $Input command with the id of year.
|
You can create a text area with your $Input command by including the -textarea parameter within the command. This will generate the standard HTML text area without styling. To customize the size and attributes of the text area, use the -customhtml parameter and the HTML textarea command as shown below.
Change Details: $input -textarea -id'details' -required -customhtml$
<textarea name="details" cols="60" rows="6"></textarea>
Prior to the custom HTML, the text box looks like this.
After this custom HTML, the text box would appear as shown below.
NOTE: If you use a textarea with a contact or interaction property, be sure to limit the amount of input accepted. Interaction Properties within the iService database are limited to 1028 characters of data. Any addition data captured by your text area will be truncated.
|