D
D
del9937882017-02-09 01:25:52
Yii
del993788, 2017-02-09 01:25:52

How to change form error validation type in yii2?

Hello. I use ActiveForm and faced the following problem: if the inputs are arranged horizontally, then the help-block block, in which errors are displayed, breaks the entire layout.
0426f5c86eed44bf81e45a50c94d5ebe.PNG
pos: absolute won't solve the problem, because the bottom blocks don't recede lower (which is not surprising), and the error text runs over the text of the next input in the list
Questions are:
1) How can I solve this problem without changing the horizontal position of the inputs?
2) In what file is a line like $('.help-block').text(error)? Searched, did not find. It would be possible to add .addClass('block'), and make it popup
3) How to display the error message in another place? In a corner, for example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-02-09
@del993788

Goodnight.
Use errorSummary
<?= $form->errorSummary($model) ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question