Browse Source

Fixed unexpected form submit on `validate()` call

Fixed `validate()` method in `yii.activeForm.js` to prevent unexpected form submit
when `forceValidate` set to `true`

Closes #13105
tags/2.0.11
SilverFire - Dmitry Naumenko 8 years ago
parent
commit
7d494c1915
No known key found for this signature in database
GPG Key ID: 39DD917A92B270A
  1. 1
      framework/CHANGELOG.md
  2. 4
      framework/assets/yii.activeForm.js

1
framework/CHANGELOG.md

@ -30,6 +30,7 @@ Yii Framework 2 Change Log
- Bug #13159: Fixed `destroy` method in `yii.captcha.js` which did not work as expected (arogachev)
- Bug #7727: Fixed truncateHtml leaving extra tags (developeruz)
- Bug #13118: Fixed `handleAction()` function in `yii.js` to handle attribute `data-pjax=0` as disabled PJAX (silverfire)
- Bug #13105: Fixed `validate()` method in `yii.activeForm.js` to prevent unexpected form submit when `forceValidate` set to `true` (silverfire)
- Enh #475: Added Bash and Zsh completion support for the `./yii` command (cebe, silverfire)
- Enh #6242: Access to validator in inline validation (arogachev)
- Enh #6373: Introduce `yii\db\Query::emulateExecution()` to force returning an empty result for a query (klimov-paul)

4
framework/assets/yii.activeForm.js

@ -306,9 +306,9 @@
needAjaxValidation = false,
messages = {},
deferreds = deferredArray(),
submitting = data.submitting;
submitting = data.submitting && !forceValidate;
if (submitting) {
if (data.submitting) {
var event = $.Event(events.beforeValidate);
$form.trigger(event, [messages, deferreds]);

Loading…
Cancel
Save