[eluser]RaGe10940[/eluser]
I am able to set up a drop down menu and all from the values in my database, but I am having a little quirk and it is really not major but it is a end user experience boost. Currently the default value for the dropdown is : Rixhers Ajazi
I however want to set it up so that the default is like so : '' => 'Choose Counselor'
how do I set that up with dynamically loaded counselor names from a DB?
I have tried to make a new options variable like so :
Code:
$options3 = array(''=>'Choose Counselor');
<?php echo form_dropdown('counselor', $options, $options3); ?>
and that returns nothing. Again the functionality is their I would rather just have it come with a default value.
This is my entire current code :
Code:
<div id="appointment">
<fieldset><legend>Only For<font color="#ff0000"><strong> Appointments</strong></font></legend>
<?php $options1 = array('' => 'Hour', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5',
'6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12')
?>
<?php $options2 = array('' => 'Minute', '00' => '00', '15' => '15', '30' => '30', '45' => '45'); ?>
<?php $options3 = array('' => ''); ?>
<?php
foreach ($staff as $s) {
$options = array($s['username'] => $s['fname'].' '.$s['lname']);
}
?>
<?php echo form_dropdown('counselor', $options); ?>
<?php echo form_dropdown('hour', $options1); ?>:<?php echo form_dropdown('minute', $options2); ?>
</fieldset>
</div>
Any help would be awesome.