0

I couldn't solve it. How can i prevent getting password while using Form::model?

By the way, in form model binding, firefox shows password area filled, but chrome..

I mean that protected $hidden = ('password') doesnt work, when i open page with firefox, i see password input is filled, but chrome not.

Thanks.

yigitozmen
  • 883
  • 2
  • 16
  • 38
  • 1
    What do you mean prevent getting password? Just use `Form::password('password')` and Laravel won't fill anything in – lukasgeiter Mar 11 '15 at 19:08
  • I think he's looking for `protected $hidden = array("password);` In whatever model he's using. But there's information missing from the question, so it's hard to say. – Tim Lewis Mar 11 '15 at 19:10
  • $hidden doesnt work, in firefox password input is filled. – yigitozmen Mar 11 '15 at 19:21
  • Oh so your form is autofilling your password and you don't want it to? – Tim Lewis Mar 11 '15 at 19:25
  • @TimLewis Yes, i don't want. And i will use 'sometimes' validation rule.. if person enter new password, then validation will work. – yigitozmen Mar 11 '15 at 19:26
  • 2
    You're looking for `autocomplete="off"` on your form, but that will affect all `` in your form. If you don't want the field to auto populate, you need to tell Firefox to forget your password. See this link for more information: http://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field-input-tag – Tim Lewis Mar 11 '15 at 19:29

1 Answers1

-1

Try adding this after the opening FORM tag:

<input style="display:none" type="text" name="fakeusernameremembered"/>
<input style="display:none" type="password" name="fakepasswordremembered"/>

I couldn't tell you why it works, but it does.

Relaxing In Cyprus
  • 1,838
  • 19
  • 24