PEAR::HTML_Menu generating a select
| From: | Alex Grasman | Date: | Fri, 04 May 2007 10:51:40 +0000 |
| Subject: | PEAR::HTML_Menu generating a select | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-27207@lists.php.net to get a copy of this message | ||
Hello all
I would like to make a HTML Select with PEAR::HTML_Menu.
I have got the follwoing so far:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test pagina</title> </head> <body> <form method="post" action="">This code returns a proper select (I used my own class to call the HTML_Menu class). But now I'd like to assign a pre-selectd value I don't know how I should do that? Does anyone have a tip or example? Thanks in advance Alex<table> <tr> <td> <?php /* Deze pagina test de category klasse */require_once('functions/category.class.php'); require_once('sources/misc.php'); $dsn = 'mysqli://' . $config['db_user'] . ':' .$config['db_pass'] . '@' . $config['db_host'] . '/' . $config['db_name'];$cat = new Category('', 'test.php?node=' . $_GET['node'],$dsn);$row_entry = array( HTML_MENU_ENTRY_INACTIVE => '<optionvalue="{url}">{indent}{title}</option>');$menu_entry = array('<select name="tree">', '</select>'); $row2_entry = array('', ''); echo $cat->getTree($row_entry, $menu_entry, $row2_entry, 1); ?> </td> </tr> </table></form> </body> </html>