NTKPassword.php 696 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class NTKPassword
  3. {
  4. function NTKPassword($id, $value = "", $style = "")
  5. {
  6. $this->id = $id;
  7. $this->value = $value;
  8. $this->style = $style;
  9. $this->events = array();
  10. }
  11. function addEvent($event, $action)
  12. {
  13. $this->events[] = array($event, $action);
  14. }
  15. function getHtml()
  16. {
  17. $html = "";
  18. $html .= "<input id=\"$this->id\" name=\"$this->id\" class=\"entry\" type=\"password\" value=\"$this->value\" style=\"".$this->style."\" ";
  19. foreach($this->events as $event)
  20. {
  21. $html .= " ".$event[0]."=\"".$event[1]."\" ";
  22. }
  23. $html .= ">\n";
  24. return $html;
  25. }
  26. }
  27. ?>