phpDocumentor form
[ class tree: form ] [ index: form ] [ all elements ]

Source for file TextField.php

Documentation is available at TextField.php

  1. <?
  2. /**
  3. * @package form
  4. * @filesource
  5. * @see HTML_FORM_COMPONENT_PATH.'/TextField.php'
  6. * @copyright (c) http://Finn-Rasmussen.com
  7. * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
  8. * @author http://Finn-Rasmussen.com
  9. * @version 1.9
  10. * @since 21-oct-2005
  11. */
  12.  
  13. /**
  14. * The required files
  15. */
  16. require_once(HTML_FORM_COMPONENT_PATH.'/Input.php');
  17.  
  18. /**
  19. * Generates an INPUT element for a form
  20. * <code>
  21. * <input type="text" name="$name" value="$value"
  22. * class="$class" size="$size" maxlength="$maxlength" />
  23. * Usage:
  24. * $textfield = new TextField($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick,$title,$tabindex);
  25. * print $textfield->getHtml();
  26. * Or
  27. * TextField::display($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick,$title,$tabindex);
  28. * </code>
  29. * @package form
  30. */
  31.  
  32. class TextField extends Input {
  33. /**
  34. * Constructor
  35. * @param String $name The name
  36. * @param String $value The value, if any
  37. * @param String $class The class
  38. * @param String $size The size
  39. * @param String $maxlength The maxlength
  40. * @param String $disabled The disabled
  41. * @param String $readonly The readonly
  42. * @param String $onclick On click event for javascript
  43. * @param String $title The title
  44. * @param String $tabindex The tabindex
  45. */
  46. function TextField($name,$value='',$class='',$size='',$maxlength='',$disabled='',$readonly='',$onclick='',$title='',$tabindex='') {
  47. $class = $class!=''?$class:CSS_TEXTFIELD_CLASS;
  48. $size = $size!=''?$size:CSS_TEXTFIELD_SIZE;
  49. $this->Input('text',$name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick,$title,$tabindex);
  50. }
  51.  
  52. /**
  53. * Display html
  54. * <code>
  55. * Usage:
  56. * TextField::display($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick,$title,$tabindex);
  57. * </code>
  58. * @static
  59. * @param String $name The name
  60. * @param String $value The value, if any
  61. * @param String $class The class
  62. * @param String $size The size
  63. * @param String $maxlength The maxlength
  64. * @param String $disabled The disabled
  65. * @param String $readonly The readonly
  66. * @param String $onclick On click event for javascript
  67. * @param String $title The title
  68. * @param String $tabindex The tabindex
  69. */
  70. function display($name='',$value='',$class='',$size='',$maxlength='',$disabled='',$readonly='',$onclick='',$title='',$tabindex='') {
  71. $html = new TextField($name,$value,$class,$size,$maxlength,$disabled,$readonly,$onclick,$title,$tabindex);
  72. $html->addHtml();
  73. }
  74. }
  75. ?>

Documentation generated on Thu, 22 Dec 2005 17:20:31 +0100 by phpDocumentor 1.3.0RC3