CWIS Developer Documentation
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 ?>
Length($NewVal=NULL)
Get or set the display length for this field.
TextFormField($Name, $IsRequired, $Label, $Length, $MaxLength, $ValidFunc=NULL, $ValidMsgs=NULL)
Object Constructor.
Generator for HTML form fields.
Definition: FormField.php:14
FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs)
Object Constructor.
Definition: FormField.php:32
PHP
Definition: OAIClient.php:39
MaxLength($NewVal=NULL)
Get or set the maximum input length for this field.
Abstraction for password forms.
Generator for text input fields.
PrintInput($DisplayErrorIndicator=FALSE)
Generate HTML for this object.