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

Source for file multiple.php

Documentation is available at multiple.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: multi-selection</title>
  7.  </head>
  8.  <body>
  9.   <form method="get" action="#">
  10.    <p>
  11. <label for="color">Select some colors:</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.  
  23. //key is used as label, value as <option value="">.
  24. $colors = array(
  25.     'red'    => '#FF0000',
  26.     'green'  => '#00FF00',
  27.     'blue'   => '#0000FF',
  28.     'orange' => '#FF8000',
  29.     'yellow' => '#FFFF00',
  30. );
  31.  
  32. //multiselect with height of 5 lines
  33. $hs = new HTML_Select('color'5true);
  34.  
  35. //preselected values are orange and red
  36. $hs->load($colorsarray('#FF8000''#FF0000'));
  37.  
  38. echo $hs->toHtml();
  39.  
  40. ?>
  41.    </p>
  42.   </form>
  43.  </body>
  44. </html>

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