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
ca35bb05
Commit
ca35bb05
authored
Aug 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced attr with prop.
parent
7e5630b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
yii.activeForm.js
framework/yii/assets/yii.activeForm.js
+6
-6
ActiveForm.php
framework/yii/widgets/ActiveForm.php
+1
-1
No files found.
framework/yii/assets/yii.activeForm.js
View file @
ca35bb05
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
var
settings
=
$
.
extend
({},
defaults
,
options
||
{});
var
settings
=
$
.
extend
({},
defaults
,
options
||
{});
if
(
settings
.
validationUrl
===
undefined
)
{
if
(
settings
.
validationUrl
===
undefined
)
{
settings
.
validationUrl
=
$form
.
attr
(
'action'
);
settings
.
validationUrl
=
$form
.
prop
(
'action'
);
}
}
$
.
each
(
attributes
,
function
(
i
)
{
$
.
each
(
attributes
,
function
(
i
)
{
attributes
[
i
]
=
$
.
extend
({
value
:
getValue
(
$form
,
this
)},
attributeDefaults
,
this
);
attributes
[
i
]
=
$
.
extend
({
value
:
getValue
(
$form
,
this
)},
attributeDefaults
,
this
);
...
@@ -291,13 +291,13 @@
...
@@ -291,13 +291,13 @@
// If the validation is triggered by form submission, ajax validation
// If the validation is triggered by form submission, ajax validation
// should be done only when all inputs pass client validation
// should be done only when all inputs pass client validation
var
$button
=
data
.
submitObject
,
var
$button
=
data
.
submitObject
,
extData
=
'&'
+
data
.
settings
.
ajaxVar
+
'='
+
$form
.
attr
(
'id'
);
extData
=
'&'
+
data
.
settings
.
ajaxVar
+
'='
+
$form
.
prop
(
'id'
);
if
(
$button
&&
$button
.
length
&&
$button
.
attr
(
'name'
))
{
if
(
$button
&&
$button
.
length
&&
$button
.
prop
(
'name'
))
{
extData
+=
'&'
+
$button
.
attr
(
'name'
)
+
'='
+
$button
.
attr
(
'value'
);
extData
+=
'&'
+
$button
.
prop
(
'name'
)
+
'='
+
$button
.
prop
(
'value'
);
}
}
$
.
ajax
({
$
.
ajax
({
url
:
data
.
settings
.
validationUrl
,
url
:
data
.
settings
.
validationUrl
,
type
:
$form
.
attr
(
'method'
),
type
:
$form
.
prop
(
'method'
),
data
:
$form
.
serialize
()
+
extData
,
data
:
$form
.
serialize
()
+
extData
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
msgs
)
{
success
:
function
(
msgs
)
{
...
@@ -380,7 +380,7 @@
...
@@ -380,7 +380,7 @@
var
getValue
=
function
(
$form
,
attribute
)
{
var
getValue
=
function
(
$form
,
attribute
)
{
var
$input
=
findInput
(
$form
,
attribute
);
var
$input
=
findInput
(
$form
,
attribute
);
var
type
=
$input
.
attr
(
'type'
);
var
type
=
$input
.
prop
(
'type'
);
if
(
type
===
'checkbox'
||
type
===
'radio'
)
{
if
(
type
===
'checkbox'
||
type
===
'radio'
)
{
return
$input
.
filter
(
':checked'
).
val
();
return
$input
.
filter
(
':checked'
).
val
();
}
else
{
}
else
{
...
...
framework/yii/widgets/ActiveForm.php
View file @
ca35bb05
...
@@ -152,7 +152,7 @@ class ActiveForm extends Widget
...
@@ -152,7 +152,7 @@ class ActiveForm extends Widget
$this
->
options
[
'id'
]
=
$this
->
getId
();
$this
->
options
[
'id'
]
=
$this
->
getId
();
}
}
if
(
!
isset
(
$this
->
fieldConfig
[
'class'
]))
{
if
(
!
isset
(
$this
->
fieldConfig
[
'class'
]))
{
$this
->
fieldConfig
[
'class'
]
=
'yii\widgets\ActiveField'
;
$this
->
fieldConfig
[
'class'
]
=
ActiveField
::
className
()
;
}
}
echo
Html
::
beginForm
(
$this
->
action
,
$this
->
method
,
$this
->
options
);
echo
Html
::
beginForm
(
$this
->
action
,
$this
->
method
,
$this
->
options
);
}
}
...
...
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