How to make an array to accept the first value to be presented in a combobox?
Hi Experts
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!
PHPjQueryJavaScriptJSONAJAX
Last Comment
Eduardo Fuerte
8/22/2022 - Mon
Rainer Jeschor
Hi,
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?
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