Search:

# CWIS Developers Documentation

- Main Page
- Classes
- Files

- File List
- File Members

# TextFormField.php

Go to the documentation of this file.

    00001 <?PHP
    00002
    00008 class TextFormField extends FormField {
    00009
    00010     # ---- PUBLIC INTERFACE --------------------------------------------------
    00011
    00014
    00026     function TextFormField(
    00027             $Name, $IsRequired, $Label, $Length, $MaxLength,
    00028             $ValidFunc = NULL, $ValidMsgs = NULL)
    00029     {
    00030         $this->MyLength = $Length;
    00031         $this->MyMaxLength = $MaxLength;
    00032
    00033         $this->FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs);
    00034     }
    00035
    00040
    00046     function Length($NewVal = NULL) {  return $this->GetOrSet("MyLength", $NewVal);  }
    00047
    00053     function MaxLength($NewVal = NULL) {  return $this->GetOrSet("MyMaxLength", $NewVal);  }
    00054
    00059
    00064     function PrintInput($DisplayErrorIndicator = FALSE)
    00065     {
    00066         print("<input type=\"".
    00067                     # (hack to support PasswordFormField object as well)
    00068                     (method_exists($this, "PasswordFormField") ? "password" : "text")
    00069                     ."\""
    00070                 ." name=\"".$this->MyName."\""
    00071                 ." value=\"".htmlspecialchars($this->MyValue)."\""
    00072                 ." size=\"".$this->MyLength."\""
    00073                 ." maxlength=\"".$this->MyMaxLength."\""
    00074                 .($DisplayErrorIndicator ? " style=\"background-color: #FFEEEE;\"" : "")
    00075                 ." />");
    00076     }
    00077
    00080     # ---- PRIVATE INTERFACE -------------------------------------------------
    00081
    00082     private $MyLength;
    00083     private $MyMaxLength;
    00084 }
    00085
    00086
    00087 ?>

Copyright 2010 Internet Scout