Source for file textfield.php
Documentation is available at textfield.php
* the textfield widget primitive
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @subpackage FormsLibrary
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/bb/configreader.php';
require_once 'field.php';
* The textfield widget primitive
* Designed for strings to be edited in a text field widget in the HTML form,
* but is inherited for TimeField, IdField etc
* @subpackage FormsLibrary
* Create a new field object, designed to be superclasses
* @param string $name the name of the field (db name, and html field name
* @param string $longname long name to be used in the label of the field in display
* @param string $description used in the html title or longdesc for the field
function TextField($name, $longname=
'', $description=
'') {
parent::Field($name, $longname, $description);
if ($conf->value('language', 'use_comma_floats', false)) {
// also convert the original db value to a float so that the comparison will be numeric
$errorclass =
($this->isValid ?
'' :
'class="inputerror"');
$t .=
"<tr $errorclass><td>$this->longname</td>\n"
for ($i=
0; $i<
$cols-
2; $i++
) {
if ($value !==
null &&
$value !==
'' &&
$t =
'<input type="text" name="'.
$this->namebase.
$this->name.
'" ';
$t .=
'value="'.
xssqw($value).
'" ';
$t .=
(isset
($this->attr['size']) ?
'size="'.
$this->attr['size'].
'" ' :
'');
$t .=
(isset
($this->attr['maxlength']) ?
'maxlength="'.
$this->attr['maxlength'].
'" ' :
'');
return "<input type='hidden' name='$this->namebase$this->name' "
Documentation generated on Tue, 06 Mar 2007 10:02:01 +0000 by phpDocumentor 1.3.0