Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LARAVEL styled password field with bootstrap

in this form i heve Form::password() and i can not styled or embeded class for that. for example this below class and style for Form::text can work correctly.

{{ Form::text('username', Input::old('username'), array('placeholder'=>'UserName', 'class'=>'form-control' ) ) }}

Generated HTML:

<input id="username" class="form-control" type="text" name="username" placeholder="username">

but for Form::password() do not work:

{{ Form::password('password', null, array('placeholder'=>'Password', 'class'=>'form-control' ) ) }}

Generated HTML:

<input id="password" type="password" value="" name="password">
like image 697
DolDurma Avatar asked Mar 01 '14 15:03

DolDurma


1 Answers

This will work:

{{ Form::password('password', array('placeholder'=>'Password', 'class'=>'form-control' ) ) }}

You don't need the null as you cannot specify a default value for password fields.

like image 157
Jozef Avatar answered Nov 10 '22 00:11

Jozef