Password Field - When Error occurs default value is gone -> WHY??

hi guys,

i have the 2 passwordFields in some of my forms (using CActiveForm):



..other form elements 

.. -->

	<div class="row">

		<?php echo $form->labelEx($model,'password'); ?>

		<?php echo $form->passwordField($model,'password',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->error($model,'password'); ?>


	<div class="row">

		<?php echo $form->labelEx($model,'password_repeat'); ?>

		<?php echo $form->passwordField($model,'password_repeat',array('size'=>45,'maxlength'=>45)); ?>

		<?php echo $form->error($model,'password_repeat'); ?>


When an error in the form occurs such as "Username cannot be blank" or "Email not valid",

the previously entered value in the 1. passwordField gets replaced by *************************.

In the 2. passwordField the previously entered value doesn’t get replaced.

What is causing this behaviour?

How can I change it?



The behaviour you want is not default

To accomplish that do the following:

<?php echo $form->passwordField($model,'password_repeat',array('size'=>45,'maxlength'=>45,'value'=>$model->password_repeat)); ?>

Thx that solved it… :wink: