I added a dummy reset action in my current controller,
public function actionReset()
{
$email = Yii::app()->request->getQuery('auth');
$model = new Wsmembers;
$result = $model->find('WSEmailAddress = :email', array(':email'=>$email));
// var_dump($result);
if($result == 1)
{
if(isset($_POST['Wsmembers']))
{
$model->attributes=$_POST['Wsmembers'];
if($model->save())
$this->redirect(array('view','id'=>$model->MemberShipID));
}
$this->render('updatepwd',array(
'model'=>$model,
));
}
then at the updatepwd view, I have this
<h1>Update Password <?php echo $model->MemberShipID; ?></h1>
<div class="form">
<?php echo CHtml::beginForm(); ?>
<?php echo CHtml::errorSummary($model)?>
<div class="row">
<?php echo CHtml::activeLabelEx($model,'WSLoginPassword'); ?>
<?php echo CHtml::activeTextField($model,'WSLoginPassword',array('size'=>20,'maxlength'=>50)); ?>
<?php echo CHtml::error($model,'WSLoginPassword'); ?>
</div>
<div class="row">
<?php echo CHtml::activeLabelEx($model,'Retype Password'); ?>
<?php echo CHtml::activePasswordField($model,'WSLoginPassword_repeat'); ?>
</div>
<div class="action">
<?php echo CHtml::submitButton('Update'); ?>
</div>
<?php echo CHtml::endForm(); ?>
</div>
now when I tried to input some wrong stuff at the form it also calls the other
field that does’t exist in my view, what I understand is, this is happening because
I instantiated my members model where all attributes are present that’s why even
the validators to the fields that doesn’t exist where also called
what should I do in order to not include those other validators for the fields
that aren’t present ?