Eduardo Fuerte
asked on
How to make an array to accept the first value to be presented in a combobox?
Hi Experts
Having this code
What must be needed to make the combo presents
- SELECT -
as the 1st line of the combo instead of undefined
Thanks in advance!
Having this code
function get_orgao($idprograma = 0)
{
// Select your records
$this->db->select('idorgao, nome');
$this->db->from('tb_orgao');
$this->db->order_by('nome');
$this->db->where('idprograma', $idprograma);
// Get the results
$results = $this->db->get()->result_array();
// Add the SELECT item to the start of the array
array_unshift($results, array('id' => '0', 'name' => 'SELECT'));
return $results;
}
What must be needed to make the combo presents
- SELECT -
as the 1st line of the combo instead of undefined
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect!
Thank you very much.
Thank you very much.
what does the PHP function generate and how is that incorporated to the page?
Could you post the resulting HTML source (not the PHP source)?
How is that dropdown filled? By HTML source or via JavaScript?
Thanks.
Rainer