Answer the question
In order to leave comments, you need to log in
Active Form, step-by-step filling, how to track errors?
Good afternoon colleagues. I make a step-by-step payment form. Made as follows. There is one large form model, I will not show it. everything is the same as in the usual.
But with types of difficulty, I’m not strong in JS, so I decided to break the steps just with tabs, maybe it’s even worth making tabs from Bootstrap. The catch is that if errors occur on the second and next step, it throws me 1 step and I need to click until the moment where these errors are written.
Actually, I just want to track the errors, and transfer to the desired step. But I have an ActiveForm and fields, respectively, of this kind
<?= $form->field($model, 'phone')->textInput(['class' => 'p-phone'])->label(false) ?>
$(document).ready(init);
function init(){
$('.twoStep').hide();
}
function hidePayCard(){
$('.payment').hide();
$('.twoStep').show();
}
function showPayCard(){
$('.payment').show();
$('.twoStep').hide();
}
Answer the question
In order to leave comments, you need to log in
my advice to you is not to reinvent the wheel, there are many extensions to solve this problem
https://www.google.com.ua/search?q=step+wizard+yii...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question