Welcome Guest, Not a member yet? Register   Sign In
Can't get value from dropdown box
#1

[eluser]huskyfritz[/eluser]
Hello there!

I am new when it comes to php and codeigniter so I just wanna ask your help debugging my simple code. Here it is:

My model
Code:
function load_combo_problemType(){
$data = array(
       '0' => '-- SELECT --',
       'Software' => array(
       '1'  => 'My Financing System',
       '2'  => 'Human Resource Management System',
       '3'  => 'Unit Tracking System',
     ),
'Hardware' => array(
'4'  => 'Computer Problem',
'5'  => 'Internet Connection',
'6'  => 'Accessories',
     )
);

return form_dropdown('cProblemtType', $data);

My view:
Code:
<tr class="create-spss-tr">
                <td><label for="cProblemType">Problem Type(*):</label></td>  
                <td>
                    &lt;?php echo $combo_problem_type;?&gt;
                </td>  
            </tr>

but when I am trying to retrieve the record using
Code:
$this->input->post('cProblemType')
in my model I don't see any value at all.

Sorry if I did not explain the problem accordingly.

Thanks.
#2

[eluser]huskyfritz[/eluser]
I found the problem, its here
Code:
return form_dropdown('cProblemtType', $data);
I type 'cProblemtType' instead 'cProblemType' as a dropdown box name

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB