yiisoft/yii2 — pull request #1958 by 6pblcb (2014-01-14 04:25:24+00:00)
Title: Transfer beforeSubmit function after global validation all fields forms

Transfer function "before Submit" immediately before submitting forms and **after** successful validation form.

This update will resolve this issue: https://github.com/yiisoft/yii2/issues/1950
Example:
```php
$form = ActiveForm::begin([
'beforeSubmit' => new \yii\web\JsExpression('function(form) {
jQuery.ajax({
url: "'. $this->context->createUrl('create') .'",
type: "POST",
dataType: "json",
data: form.serialize(),
success: function(response) {
...
//cancel default submitting form
return false;
},
error: function(response) {
...
//continue default submitting form
return true;
}
});
}')
]);
```