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
f6e34756
Commit
f6e34756
authored
May 02, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.yiisoft.com:yii2
parents
e6af955b
66b123bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
yii.activeForm.js
framework/assets/yii.activeForm.js
+4
-4
yii.validation.js
framework/assets/yii.validation.js
+15
-5
No files found.
framework/assets/yii.activeForm.js
View file @
f6e34756
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
// the container CSS class representing the corresponding attribute has validation error
// the container CSS class representing the corresponding attribute has validation error
errorCssClass
:
'error'
,
errorCssClass
:
'error'
,
// the container CSS class representing the corresponding attribute passes validation
// the container CSS class representing the corresponding attribute passes validation
successCssClass
:
'success'
,
successCssClass
:
'success'
,
// the container CSS class representing the corresponding attribute is being validated
// the container CSS class representing the corresponding attribute is being validated
validatingCssClass
:
'validating'
,
validatingCssClass
:
'validating'
,
// a callback that is called before validating any attribute
// a callback that is called before validating any attribute
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
return
this
.
each
(
function
()
{
return
this
.
each
(
function
()
{
$
(
window
).
unbind
(
'.yiiActiveForm'
);
$
(
window
).
unbind
(
'.yiiActiveForm'
);
$
(
this
).
removeData
(
'yiiActiveForm'
);
$
(
this
).
removeData
(
'yiiActiveForm'
);
})
})
;
}
}
};
};
...
@@ -220,7 +220,7 @@
...
@@ -220,7 +220,7 @@
/**
/**
* Performs the ajax validation request.
* Performs the ajax validation request.
* This method is invoked internally to trigger the ajax validation.
* This method is invoked internally to trigger the ajax validation.
* @param form jquery the jquery representation of the form
* @param
$
form jquery the jquery representation of the form
* @param successCallback function the function to be invoked if the ajax request succeeds
* @param successCallback function the function to be invoked if the ajax request succeeds
* @param errorCallback function the function to be invoked if the ajax request fails
* @param errorCallback function the function to be invoked if the ajax request fails
*/
*/
...
@@ -352,7 +352,7 @@
...
@@ -352,7 +352,7 @@
* updates the error message and the input container for a particular attribute.
* updates the error message and the input container for a particular attribute.
* @param attribute object the configuration for a particular attribute.
* @param attribute object the configuration for a particular attribute.
* @param messages array the json data obtained from the ajax validation request
* @param messages array the json data obtained from the ajax validation request
* @param form the form jQuery object
* @param
$
form the form jQuery object
* @return boolean whether there is a validation error for the specified attribute
* @return boolean whether there is a validation error for the specified attribute
*/
*/
var
updateInput
=
function
(
$form
,
attribute
,
messages
)
{
var
updateInput
=
function
(
$form
,
attribute
,
messages
)
{
...
...
framework/assets/yii.validation.js
View file @
f6e34756
...
@@ -27,7 +27,9 @@ yii.validation = (function ($) {
...
@@ -27,7 +27,9 @@ yii.validation = (function ($) {
valid
=
true
;
valid
=
true
;
}
}
valid
||
messages
.
push
(
options
.
message
);
if
(
!
valid
)
{
messages
.
push
(
options
.
message
);
}
},
},
boolean
:
function
(
value
,
messages
,
options
)
{
boolean
:
function
(
value
,
messages
,
options
)
{
...
@@ -37,7 +39,9 @@ yii.validation = (function ($) {
...
@@ -37,7 +39,9 @@ yii.validation = (function ($) {
var
valid
=
!
options
.
strict
&&
(
value
==
options
.
trueValue
||
value
==
options
.
falseValue
)
var
valid
=
!
options
.
strict
&&
(
value
==
options
.
trueValue
||
value
==
options
.
falseValue
)
||
options
.
strict
&&
(
value
===
options
.
trueValue
||
value
===
options
.
falseValue
);
||
options
.
strict
&&
(
value
===
options
.
trueValue
||
value
===
options
.
falseValue
);
valid
||
messages
.
push
(
options
.
message
);
if
(
!
valid
)
{
messages
.
push
(
options
.
message
);
}
},
},
string
:
function
(
value
,
messages
,
options
)
{
string
:
function
(
value
,
messages
,
options
)
{
...
@@ -86,7 +90,9 @@ yii.validation = (function ($) {
...
@@ -86,7 +90,9 @@ yii.validation = (function ($) {
var
valid
=
!
options
.
not
&&
$
.
inArray
(
value
,
options
.
range
)
var
valid
=
!
options
.
not
&&
$
.
inArray
(
value
,
options
.
range
)
||
options
.
not
&&
!
$
.
inArray
(
value
,
options
.
range
);
||
options
.
not
&&
!
$
.
inArray
(
value
,
options
.
range
);
valid
||
messages
.
push
(
options
.
message
);
if
(
!
valid
)
{
messages
.
push
(
options
.
message
);
}
},
},
regularExpression
:
function
(
value
,
messages
,
options
)
{
regularExpression
:
function
(
value
,
messages
,
options
)
{
...
@@ -106,7 +112,9 @@ yii.validation = (function ($) {
...
@@ -106,7 +112,9 @@ yii.validation = (function ($) {
var
valid
=
value
.
match
(
options
.
pattern
)
&&
(
!
options
.
allowName
||
value
.
match
(
options
.
fullPattern
));
var
valid
=
value
.
match
(
options
.
pattern
)
&&
(
!
options
.
allowName
||
value
.
match
(
options
.
fullPattern
));
valid
||
messages
.
push
(
options
.
message
);
if
(
!
valid
)
{
messages
.
push
(
options
.
message
);
}
},
},
url
:
function
(
value
,
messages
,
options
)
{
url
:
function
(
value
,
messages
,
options
)
{
...
@@ -182,7 +190,9 @@ yii.validation = (function ($) {
...
@@ -182,7 +190,9 @@ yii.validation = (function ($) {
break
;
break
;
}
}
valid
||
messages
.
push
(
options
.
message
);
if
(
!
valid
)
{
messages
.
push
(
options
.
message
);
}
}
}
};
};
})(
jQuery
);
})(
jQuery
);
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