Can you display a Form::password
as text instead of the dots/bullets that are default in Laravel
?
I want this instead of this
Can you display a Form::password
as text instead of the dots/bullets that are default in Laravel
?
I want this instead of this
No. Form::password
creates an <input type="password">
HTML tag, which all modern browsers will render with its value masked for security reasons. You can't change that, you can only use text type input instead.
<input type="password" id="password">
<input type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'"> Display password
You shouldn't show the password to your users. The characters in a password field are masked.
Here is the field generation just to explain you :
<!--Generating A Text Input-->
Form::text('password')
<!--Generating A Password Input. The characters in a password field are masked-->
Form::password('password');
Good read : http://laravel.com/docs/html
<!-- Following textbox will show the password in text -->
Password: <input type="text" name="pwd">
<!-- Following textbox will show password as asterisks or circles. The characters in a password field are masked -->
Password: <input type="password" name="pwd">
If you've told your users that this is a "password" of some sort, you should NEVER display it in clear text. They will expect it to be obscured by dots during entry. Why do they need to see the clear text? That is never done with passwords on any system.
What kind of "authentication" do you need, and why do you need to display the clear text in order to do it? The text you get back from the form should be "clear" to the program... it's just not visible to users.
Ofcourse you can do that! As Ravi Rokkam says: Just create an input-element with type=text instead of type=password with Form::text('password').
You can do it with plain HTML right in the template or extend Laravels form builder class.
With the help of JavaScript it's also possible to create an input-elemnt that displays its value (maybe a placeholder like "password"?) but if the users focuses it it displays bullets. (Create an input-element with type=text and when the focus-event triggers, change the type to password)