The yii\widgets\ActiveForm widget comes with a set of JavaScript methods that are used for client validation.
Its implementation is very flexible and allows you to extend it in different ways.
In the following these are described.

While validation can be made on client side or via AJAX request, the form submission itself is done
as a normal request by default. If you want the form to be submitted via AJAX, you can achieve this
by handling the beforeSubmit event of the form in the following way:

In modern web applications you often have the need of changing a form after it has been displayed to the user.
This can for example be the addition of new fields after click on a "plus"-icon.
To enable client validation for these fields, they have to be registered with the ActiveForm JavaScript plugin.