HTML_Select
[ class tree: HTML_Select ] [ index: HTML_Select ] [ all elements ]

Source for file attributes.php

Documentation is available at attributes.php

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5.  <head>
  6.   <title>HTML_Select demo: attributes</title>
  7.  </head>
  8.  <body>
  9.   <form method="get" action="#">
  10.    <p>
  11. <label for="color">Select a color:</label>
  12. <?php
  13. /**
  14.  * Demo for HTML_Select with multiple attributes
  15.  */
  16. //you do *not* need the following line!
  17.     dirname(__FILE__'/../'
  18.     . PATH_SEPARATOR . get_include_path()
  19. );
  20.  
  21. require_once 'HTML/Select.php';
  22. $hs = new HTML_Select('color');
  23. //with addOption, you can specify additional attributes
  24. $hs->addOption('red',    '#FF0000'falsearray('style' => 'color: #F00'));
  25. $hs->addOption('green',  '#00FF00'falsearray('style' => 'color: #0F0'));
  26. $hs->addOption('blue',   '#0000BB'truearray('style' => 'color: #00F'));
  27. $hs->addOption('orange''#FF8000'falsearray('style' => 'color: #FF8000'));
  28. echo $hs->toHtml();
  29.  
  30. ?>
  31.    </p>
  32.   </form>
  33.  </body>
  34. </html>

Documentation generated on Mon, 11 Mar 2019 15:47:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.