Question

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">
Was it helpful?

Solution

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.

OTHER TIPS

You can also use a custom HTML macro that enables the syntax similar to your first example.

See my answer here: How to pass value to Password field in Laravel

This problem occurred when the null value in the password.


 {!! Form::password('password', old('password'), ['class' => 'form-control ', 'placeholder' => 'Enter Password']) !!}

Please Remove the old('password'):


{!! Form::password('password', ['class' => 'form-control', 'placeholder' => 'Enter Password']) !!}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top