anurodh
anurodh

Reputation: 295

pre populationg password field zend framework

I have created a login form with a remember me checkbox. I have set cookie if the user checks the remember me link. I read the cookie the next time user opens the page. I am able to populate the username field but I'm unable to populate the password field. Is there any way to populate it?

Upvotes: 3

Views: 928

Answers (3)

ayan sil
ayan sil

Reputation: 91

Although I would recommend against this but you can do this in the following way

 <script>
 $(document).ready(function(){$('#id_of_the_password_field').val('<?php echo $variable_containing_password;?>');});
 </script>

Upvotes: 0

Regis
Regis

Reputation: 142

You have to set "true" to the propertie "renderPassword" like:

$password = new Zend_Form_Element_Password('senha');
$password->renderPassword = true;
$password->setValue("Senha");

Upvotes: 3

ashurexm
ashurexm

Reputation: 6335

You should never pre-populate the password field. You would be taking the user's password and putting it in plain text in the value attribute of the element. Here is an example of implementing remember me functionality in Zend Framework. It may not be 100% current, but its a decent jumping off point.

Upvotes: 3

Related Questions