I have the following code:
<h2>Add System</h2>
<?php
echo $this->Form->create('ReleaseServer');
echo $this->Form->input('server_name',array('error'=>array(
0 => 'Please choose a system name'),
'label'=>'System Name'
));
echo $this->Form->input('server_id', array('label'=> 'System ID'));
echo $this->Form->select('server_environment', $environments, null, array(
'empty' => "-- Select an Environment --",
'label' => "Select an Environment",
'error' => array(0 => 'Please choose an environment!'),
'onchange'=>'console.log(this.value);'
)
);
echo $this->Form->end('Save System');
?>
For some reason the line
echo $this->Form->input('server_id', array('label'=> 'System ID'));
shows up as a select box no matter where I place it.
How do I resolve this?
You could try adding
typeto your options array and explicitly defining what you want the input to be.Edit
After digging around in the Cake API I think I may have found a specific line of code that may be affecting you here.
It appears likely that you are triggering this
ifconditional. If so, your only option is to explicitly set thetypeattribute in your options array.