3 # FILE: TextFormField.php
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/
17 # ---- PUBLIC INTERFACE --------------------------------------------------
34 $Name, $IsRequired, $Label, $Length, $MaxLength,
35 $ValidFunc = NULL, $ValidMsgs = NULL)
37 $this->MyLength = $Length;
38 $this->MyMaxLength = $MaxLength;
40 $this->
FormField($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs);
53 function Length($NewVal = NULL) {
return $this->GetOrSet(
"MyLength", $NewVal); }
60 function MaxLength($NewVal = NULL) {
return $this->GetOrSet(
"MyMaxLength", $NewVal); }
73 print(
"<input type=\"".
75 (method_exists($this,
"PasswordFormField") ?
"password" :
"text")
77 .
" name=\"".$this->MyName.
"\""
78 .
" value=\"".htmlspecialchars($this->MyValue).
"\""
79 .
" size=\"".$this->MyLength.
"\""
80 .
" maxlength=\"".$this->MyMaxLength.
"\""
81 .($DisplayErrorIndicator ?
" style=\"background-color: #FFEEEE;\"" :
"")
87 # ---- PRIVATE INTERFACE -------------------------------------------------
Length($NewVal=NULL)
Get or set the display length for this field.
TextFormField($Name, $IsRequired, $Label, $Length, $MaxLength, $ValidFunc=NULL, $ValidMsgs=NULL)
Object Constructor.
MaxLength($NewVal=NULL)
Get or set the maximum input length for this field.
Generator for text input fields.
PrintInput($DisplayErrorIndicator=FALSE)
Generate HTML for this object.