mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fixes #15791: Added a warning when the form names conflict
This commit is contained in:
committed by
Alexander Makarov
parent
9a3b3a759b
commit
a953e7e423
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
|||||||
2.0.16 under development
|
2.0.16 under development
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
- Bug #15791: Added a warning when the form names conflict (s1lver, rustamwin)
|
||||||
- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)
|
- Enh #16151: `ActiveQuery::getTableNameAndAlias()` is now protected (s1lver)
|
||||||
- Bug #16657: Ensure widgets after run event result contains the result of the rendered widget (AdeAttwood)
|
- Bug #16657: Ensure widgets after run event result contains the result of the rendered widget (AdeAttwood)
|
||||||
- Bug #14230: Fixed `itemsOptions` ignored in `checkBoxList` (s1lver)
|
- Bug #14230: Fixed `itemsOptions` ignored in `checkBoxList` (s1lver)
|
||||||
|
|||||||
@ -57,7 +57,7 @@ window.yii = (function ($) {
|
|||||||
* The selector for clickable elements that need to support confirmation and form submission.
|
* The selector for clickable elements that need to support confirmation and form submission.
|
||||||
*/
|
*/
|
||||||
clickableSelector: 'a, button, input[type="submit"], input[type="button"], input[type="reset"], ' +
|
clickableSelector: 'a, button, input[type="submit"], input[type="button"], input[type="reset"], ' +
|
||||||
'input[type="image"]',
|
'input[type="image"]',
|
||||||
/**
|
/**
|
||||||
* The selector for changeable elements that need to support confirmation and form submission.
|
* The selector for changeable elements that need to support confirmation and form submission.
|
||||||
*/
|
*/
|
||||||
@ -160,7 +160,18 @@ window.yii = (function ($) {
|
|||||||
pjax = $e.data('pjax'),
|
pjax = $e.data('pjax'),
|
||||||
usePjax = pjax !== undefined && pjax !== 0 && $.support.pjax,
|
usePjax = pjax !== undefined && pjax !== 0 && $.support.pjax,
|
||||||
pjaxContainer,
|
pjaxContainer,
|
||||||
pjaxOptions = {};
|
pjaxOptions = {},
|
||||||
|
conflictParams = ['submit', 'reset', 'elements', 'length', 'name', 'acceptCharset',
|
||||||
|
'action', 'enctype', 'method', 'target'];
|
||||||
|
|
||||||
|
// Forms and their child elements should not use input names or ids that conflict with properties of a form,
|
||||||
|
// such as submit, length, or method.
|
||||||
|
$.each(conflictParams, function (index, param) {
|
||||||
|
if (areValidParams && params.hasOwnProperty(param)) {
|
||||||
|
console.error("Parameter name '" + param + "' conflicts with a same named form property. " +
|
||||||
|
"Please use another name.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (usePjax) {
|
if (usePjax) {
|
||||||
pjaxContainer = $e.data('pjax-container');
|
pjaxContainer = $e.data('pjax-container');
|
||||||
|
|||||||
Reference in New Issue
Block a user