2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
17 // | Bertrand Mansion <bmansion@mamasam.com> |
18 // +----------------------------------------------------------------------+
22 require_once("HTML/QuickForm/input.php");
25 * HTML class for a text field
27 * @author Adam Daniel <adaniel1@eesus.jnj.com>
28 * @author Bertrand Mansion <bmansion@mamasam.com>
33 class HTML_QuickForm_text
extends HTML_QuickForm_input
41 * @param string $elementName (optional)Input field name attribute
42 * @param string $elementLabel (optional)Input field label
43 * @param mixed $attributes (optional)Either a typical HTML attribute string
44 * or an associative array
49 function HTML_QuickForm_text($elementName=null, $elementLabel=null, $attributes=null)
51 HTML_QuickForm_input
::HTML_QuickForm_input($elementName, $elementLabel, $attributes);
52 $this->_persistantFreeze
= true;
53 $this->setType('text');
60 * Sets size of text field
62 * @param string $size Size of text field
67 function setSize($size)
69 $this->updateAttributes(array('size'=>$size));
76 * Sets maxlength of text field
78 * @param string $maxlength Maximum length of text field
83 function setMaxlength($maxlength)
85 $this->updateAttributes(array('maxlength'=>$maxlength));
86 } //end func setMaxlength
90 } //end class HTML_QuickForm_text