M
M
Mikha Pankratov2016-03-09 13:23:21
Yii
Mikha Pankratov, 2016-03-09 13:23:21

How to display just a header error message?

Good afternoon,
I can’t find how to display the header error message using yii2/. (but don't summarize)
For example - There are some errors in the form..
I try like this
$form->error($model, 'text_error');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Arutyunov, 2016-03-09
@arutyunov

Methods getFirstError, getFirstErrors, hasErrors
ajax validation and validation on the client:

$('#contact-form').on('beforeSubmit', function (e) {
    if (!confirm("Everything is correct. Submit?")) {
        return false;
    }
    return true;
});

About validation on the client in yii2
Issue on github with several solutions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question