3 * Template_Lite {html_textbox} function plugin
7 * Purpose: Creates a textbox
9 * - name = the name of the textbox
10 * - rows = optional number of rows in the textbox
11 * - cols = optional number of columns in the textbox
12 * - value = optional preset value to put in the textbox
13 * Author: Paul Lockaby <paul@paullockaby.com>
15 function tpl_function_html_textbox($params, &$tpl)
17 require_once("shared.escape_chars.php");
22 foreach($params as $_key => $_value)
33 $extra .= ' ' . $_key . '="' . tpl_escape_chars($_value) . '"';
37 throw new Template_Exception("html_textbox: attribute '$_key' cannot be an array", $tpl);
42 if (!isset($name) ||
empty($name))
44 throw new Template_Exception("html_textbox: missing 'name' parameter", $tpl);
48 $toReturn = '<textarea name="' . tpl_escape_chars($name) . '" ' . $extra . '>' . tpl_escape_chars($value) . '</textarea>';