CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

TextFormField.php
Go to the documentation of this file.
1 <?PHP
2 #
3 # FILE: TextFormField.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis/
8 #
9
15 class TextFormField extends FormField {
16
17 # ---- PUBLIC INTERFACE --------------------------------------------------
18
21
33 function TextFormField(
34 $Name, $IsRequired, $Label, $Length, $MaxLength,
35 $ValidFunc = NULL, $ValidMsgs = NULL)
36 {
37 $this->MyLength = $Length;
38 $this->MyMaxLength = $MaxLength;
39
40 $this->FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs);
41 }
42
47
53 function Length($NewVal = NULL) { return $this->GetOrSet("MyLength", $NewVal); }
54
60 function MaxLength($NewVal = NULL) { return $this->GetOrSet("MyMaxLength", $NewVal); }
61
66
71 function PrintInput($DisplayErrorIndicator = FALSE)
72 {
73 print("<input type=\"".
74 # (hack to support PasswordFormField object as well)
75 (method_exists($this, "PasswordFormField") ? "password" : "text")
76 ."\""
77 ." name=\"".$this->MyName."\""
78 ." value=\"".htmlspecialchars($this->MyValue)."\""
79 ." size=\"".$this->MyLength."\""
80 ." maxlength=\"".$this->MyMaxLength."\""
81 .($DisplayErrorIndicator ? " style=\"background-color: #FFEEEE;\"" : "")
82 ." />");
83 }
84
87 # ---- PRIVATE INTERFACE -------------------------------------------------
88
89 private $MyLength;
90 private $MyMaxLength;
91 }
92
93
94 ?>
TextFormField\Length
Length($NewVal=NULL)
Get or set the display length for this field.
Definition: TextFormField.php:53
TextFormField\TextFormField
TextFormField($Name, $IsRequired, $Label, $Length, $MaxLength, $ValidFunc=NULL, $ValidMsgs=NULL)
Object Constructor.
Definition: TextFormField.php:33
FormField
Generator for HTML form fields.
Definition: FormField.php:14
FormField\FormField
FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs)
Object Constructor.
Definition: FormField.php:32
PHP
PHP
Definition: RSSClient--Test.php:12
TextFormField\MaxLength
MaxLength($NewVal=NULL)
Get or set the maximum input length for this field.
Definition: TextFormField.php:60
PasswordFormField
Abstraction for password forms.
Definition: PasswordFormField.php:16
TextFormField
Generator for text input fields.
Definition: TextFormField.php:15
TextFormField\PrintInput
PrintInput($DisplayErrorIndicator=FALSE)
Generate HTML for this object.
Definition: TextFormField.php:71