Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
82037bc7
Commit
82037bc7
authored
Sep 22, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5124: Added support to prevent duplicated form submission when using `ActiveForm`
parent
ac7e3bdb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
yii.activeForm.js
framework/assets/yii.activeForm.js
+6
-2
No files found.
framework/CHANGELOG.md
View file @
82037bc7
...
...
@@ -216,6 +216,7 @@ Yii Framework 2 Change Log
-
Enh #5058: Added
`$pageSize`
parameter to
`Pagination::createUrl()`
to allow creating URLs with arbitrary page sizes (cdcchen, qiangxue)
-
Enh #5089: Added asset debugger panel (arturf, qiangxue)
-
Enh #5117: Added
`beforeFilter`
and
`afterFilter`
JS events to
`GridView`
(kartik-v)
-
Enh #5124: Added support to prevent duplicated form submission when using
`ActiveForm`
(qiangxue)
-
Enh: Added support for using sub-queries when building a DB query with
`IN`
condition (qiangxue)
-
Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
-
Enh: Added
`yii\web\UrlManager::addRules()`
to simplify adding new URL rules (qiangxue)
...
...
framework/assets/yii.activeForm.js
View file @
82037bc7
...
...
@@ -349,11 +349,15 @@
data
=
$form
.
data
(
'yiiActiveForm'
);
if
(
data
.
validated
)
{
if
(
!
data
.
submitting
)
{
// form is being submitted. Do nothing to avoid duplicated form submission
return
false
;
}
data
.
submitting
=
false
;
var
event
=
$
.
Event
(
events
.
beforeSubmit
);
$form
.
trigger
(
event
,
[
$form
]
);
$form
.
trigger
(
event
);
if
(
event
.
result
===
false
)
{
data
.
validated
=
false
;
data
.
submitting
=
false
;
return
false
;
}
return
true
;
// continue submitting the form since validation passes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment