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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
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 @@
var
settings
=
$
.
extend
({},
defaults
,
options
||
{});
if
(
settings
.
validationUrl
===
undefined
)
{
settings
.
validationUrl
=
$form
.
attr
(
'action'
);
settings
.
validationUrl
=
$form
.
prop
(
'action'
);
}
$
.
each
(
attributes
,
function
(
i
)
{
attributes
[
i
]
=
$
.
extend
({
value
:
getValue
(
$form
,
this
)},
attributeDefaults
,
this
);
...
...
@@ -291,13 +291,13 @@
// If the validation is triggered by form submission, ajax validation
// should be done only when all inputs pass client validation
var
$button
=
data
.
submitObject
,
extData
=
'&'
+
data
.
settings
.
ajaxVar
+
'='
+
$form
.
attr
(
'id'
);
if
(
$button
&&
$button
.
length
&&
$button
.
attr
(
'name'
))
{
extData
+=
'&'
+
$button
.
attr
(
'name'
)
+
'='
+
$button
.
attr
(
'value'
);
extData
=
'&'
+
data
.
settings
.
ajaxVar
+
'='
+
$form
.
prop
(
'id'
);
if
(
$button
&&
$button
.
length
&&
$button
.
prop
(
'name'
))
{
extData
+=
'&'
+
$button
.
prop
(
'name'
)
+
'='
+
$button
.
prop
(
'value'
);
}
$
.
ajax
({
url
:
data
.
settings
.
validationUrl
,
type
:
$form
.
attr
(
'method'
),
type
:
$form
.
prop
(
'method'
),
data
:
$form
.
serialize
()
+
extData
,
dataType
:
'json'
,
success
:
function
(
msgs
)
{
...
...
@@ -380,7 +380,7 @@
var
getValue
=
function
(
$form
,
attribute
)
{
var
$input
=
findInput
(
$form
,
attribute
);
var
type
=
$input
.
attr
(
'type'
);
var
type
=
$input
.
prop
(
'type'
);
if
(
type
===
'checkbox'
||
type
===
'radio'
)
{
return
$input
.
filter
(
':checked'
).
val
();
}
else
{
...
...
framework/yii/widgets/ActiveForm.php
View file @
ca35bb05
...
...
@@ -152,7 +152,7 @@ class ActiveForm extends Widget
$this
->
options
[
'id'
]
=
$this
->
getId
();
}
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
);
}
...
...
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