hi i want to reset my password. while login if user forgets his password, he should be able to reset password by providing his email. thats my aim. here’s what i have done
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
?>
<script type="text/javascript">
function validate_dropdown(email)
{
var email = $("#loginform-email").val();
var a="<?php echo \Yii::$app->getUrlManager()->createUrl(['/account/reset'])?>&email="+email;
//~alert(a); //it shows correct url
//~ alert(email);
window.location="<?php echo \Yii::$app->getUrlManager()->createUrl(['/account/reset'])?>&email="+email;
}
</script>
<div class="users-form col-md-5">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'email')->textInput(['maxlength' => 200],['id'=>'email']) ?>
<?= $form->field($model, 'password')->passwordInput(['maxlength' => 200]) ?>
<div class="form-group">
<div class="col-lg-offset-1 col-lg-14">
<?= Html::submitButton('Login', ['class'=>'btn btn-danger btn-block btn-lg', 'name' => 'login-button']) ?>
</div>
</div>
<?= Html::a('Reset Password? ', [''], ['class'=>'btn btn-link','onclick'=>'js:validate_dropdown()']) ?>
<?php ActiveForm::end(); ?>
Don't have an account yet? <?= Html::a('SIGN UP', ['/users/signup'], ['class'=>'btn btn-link']) ?>
</div>
but when i click the reset password link its not redirecting to users/reset anyone know why ?
thanks