Reputation: 11469
I have this code in cake php but it generates a bunch of labels along with the input that I do not like. How can I get rid of them? I just want the input.
echo $this->Form->hidden('user_role', array('value'=> '2'));
echo $this->Form->input('user_username');
echo $this->Form->input('user_password', array('type' => 'password'));
echo $this->Form->input('user_fname');
echo $this->Form->input('user_lname');
echo $this->Form->input('user_email');
echo $this->Form->input('user_phone');
echo $this->Form->input('user_cellphone');
echo $this->Form->input('user_address1');
echo $this->Form->input('user_address2');
echo $this->Form->input('user_city');
echo $this->Form->input('user_zip');
echo $this->Form->end('Submit');
Thank you
Upvotes: 5
Views: 9057
Reputation: 1079
Labels are good for usability. But you can remove them in each form field adding the following:
$this->Form->input('user_username', array( 'label' => false ));
You can also disable labels by default when creating the form:
$this->Form->create('User', array('inputDefaults' => array('label' => false)));
Futher information available at their site:
Upvotes: 19