Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codeigniter - input form placeholder

Hey all, how can I use the placeholder tag in CodeIgniter's form_input() helper function?

Thanks :)

like image 368
Simon Avatar asked Dec 03 '22 03:12

Simon


1 Answers

Do you mean the placeholder attribute (not tag)? form_input() takes a third parameter with additional attributes.

$opts = 'placeholder="Username"';
form_input('username', '', $opts);

Or you can pass form_input() an array.

form_input(array(
  'name' => 'username',
  'value' => '',
  'placeholder' => 'Username',
));

CodeIgniter Form Helper

like image 136
Rocket Hazmat Avatar answered Dec 22 '22 20:12

Rocket Hazmat