0

My starting point is to write the registration page itself. Next I went to the author sign with auth component. This is the problem. In the registration page. Password box. Whenever I press the button to submit. Whether in the field is populated or not. A password appears. I recognize the problem because I am before I could use auth component not problem

Thank for suggest beginner

krissanawat
  • 616
  • 1
  • 11
  • 36

1 Answers1

0

This is most likely your browser autofilling the field.

You can set to autocomplete="off" on the form and the password box. This has limited browser support and validates only as HTML5 (I think). More details on this thread : How do you disable browser Autocomplete on web form field / input tag?

However, if this happens after you submit an empty form and the page reloads showing the validations, then it's due to the Auth component hashing an empty value. This can be solved by explicitly setting an empty value on the password box on page load

Community
  • 1
  • 1
JohnP
  • 49,507
  • 13
  • 108
  • 140
  • No, it is not associated with autocompleate. I have tried to insert comments. If there is no Auth component does not contain this problem at all. When I add value to whatever is in the box. Then confirm the value it will be taking part, I do not know what values ​​to use fire bug check I've found. value = "9d2748e4a83d07b74cdfd3febdd9417e9b440a6c" I have tried by removing the decoder and passed to md5 sha1. Nevertheless, I do not see anything. – krissanawat May 08 '11 at 05:59
  • ok, that's the auth component kicking in. When you submit an empty value, the Auth component will hash it automatically. If the form reloads because of error it will show you the hashed value. What you need to do is explicitly set the value of the input to empty in your view. This will fix the problem. _The password should not be shown on page reload_ – JohnP May 08 '11 at 06:20
  • hey john i try to set input('password',array('value'=>''); i got empty value back when i fill data in password box and press submit this is image before fill now $form->input('password) http://uppic.net/full/fd1d1d1db09962c1da018c851577c2b9 this is image after fill $form->input('password',array('value'=>'') http://uppic.net/full/5b9b53799f6341e0826f0cfee0b65041 – krissanawat May 08 '11 at 07:31
  • well you need to add an empty value to both. And remember you need to call the `password()` method from AuthComponent to hash the text entered in the confirmation box. Otherwise those two fields will never match : http://book.cakephp.org/view/1255/AuthComponent-Methods#password-1263 . Also, please go back and accept answers to your older questions. People will not help you if you don't accept answers – JohnP May 08 '11 at 08:06
  • sorry John, I'm beginner and i weak in english i can try translate you comment with google and i don't understand you comment I have tried to do it yourself hope you understand and I try to read manual and I input if ($this->data['Member']['password'] == $this->Auth->password($this->data['Member']['password_confirm'])){ to register function but remains the same – krissanawat May 09 '11 at 06:09
  • What you're doing is fine. All you have to do is put `$this->Form->input('password', array('value' => ''))` in your view. Do this for your `password_confirm` field as well. This will make the fields be empty on reload. And again, please go back and accept answers to your previous questions – JohnP May 09 '11 at 06:17