Hopefully this will help get you started in the right direction:
in your header_php.php, you need something like this:
PHP Code:
// do you want to set a default selection? if not, use '0':
$default_pulldown_selection = '2';
//For validation, you're looking for the contents of the $_POST['my_pulldown_menu'] variable
// this is only set after "submit" is clicked.
$pulldown_selected_item = (isset($_POST['my_pulldown_menu'])) ? $_POST['my_pulldown_menu'] : $default_pulldown_selection ;
//build an array of entries to be displayed on the template:
$pulldown_contents[] = array('id'=>'0', 'text'=>'Please Select');
$pulldown_contents[] = array('id'=>'1', 'text'=>'Choice Number 1');
$pulldown_contents[] = array('id'=>'2', 'text'=>'Choice Number 2');
$pulldown_contents[] = array('id'=>'3', 'text'=>'Choice Number 3');
$pulldown_contents[] = array('id'=>'4', 'text'=>'Choice Number 4');
$pulldown_contents[] = array('id'=>'5', 'text'=>'Choice Number 5');
// you could add some validation here.
if ($pulldown_selected_item==0) {
$messageStack->add_session('header','Please select an option from the pulldown menu','error');
}
In your template, display the contents:
PHP Code:
echo zen_draw_pull_down_menu('my_pulldown_menu', $pulldown_contents, $pulldown_selected_item);
Bookmarks