Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-portal-fe
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
weiqingting
9 years ago
Commit
7247f354ee61a026942a4ae30684430213a96fb2
1 parent
39efc695
bug修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
client/js/common/edit.js
client/js/common/edit.js
View file @
7247f35
...
...
@@ -208,7 +208,6 @@ edit.prototype={
$
(
"input:text"
,
that
.
el
)
.
add
(
"input[type=number]"
,
that
.
el
)
.
add
(
"input:hidden"
,
that
.
el
)
.
add
(
"textarea"
,
that
.
el
)
.
each
(
function
()
{
...
...
@@ -220,7 +219,7 @@ edit.prototype={
var
name
=
$
(
this
).
attr
(
"placeholder"
)
&&!
(
/^
\d
+$/
.
test
(
$
(
this
).
attr
(
"placeholder"
)))?
$
(
this
).
attr
(
"placeholder"
).
replace
(
/请填写/g
,
''
):
$
(
this
).
parents
(
".form-group"
).
find
(
"label"
).
text
().
replace
(
/
\*
/g
,
''
);
// var rule = [];
if
(
$
(
this
).
attr
(
"required"
))
{
if
(
id
&&
$
(
this
).
attr
(
"required"
))
{
new
Validator
.
init
(
document
.
getElementById
(
id
),{
rules
:{
required
:
true
}
}).
validate
(
function
(
obj
){
...
...
@@ -246,14 +245,25 @@ edit.prototype={
});
//文件上传
$
(
"input[type=file]"
,
that
.
el
).
each
(
function
(){
var
id
=
$
(
this
).
attr
(
"id"
);
var
value
=
$
.
trim
(
$
(
this
).
attr
(
"value"
));
var
name
=
$
(
this
).
attr
(
"placeholder"
)
&&!
(
/^
\d
+$/
.
test
(
$
(
this
).
attr
(
"placeholder"
)))?
$
(
this
).
attr
(
"placeholder"
).
replace
(
/请填写/g
,
''
):
$
(
this
).
parents
(
".form-group"
).
find
(
"label"
).
text
().
replace
(
/
\*
/g
,
''
);
if
(
$
(
this
).
attr
(
"required"
)
&&!
value
)
{
if
(
id
&&
$
(
this
).
attr
(
"required"
)
&&!
value
)
{
err
.
push
(
"<p>"
+
name
+
"不可为空</p>"
);
}
});
//下拉选择
$
(
"select"
,
that
.
el
).
each
(
function
(){
var
id
=
$
(
this
).
attr
(
"id"
);
var
value
=
$
.
trim
(
$
(
this
).
val
());
var
name
=
$
(
this
).
attr
(
"placeholder"
)
&&!
(
/^
\d
+$/
.
test
(
$
(
this
).
attr
(
"placeholder"
)))?
$
(
this
).
attr
(
"placeholder"
).
replace
(
/请填写/g
,
''
):
$
(
this
).
parents
(
".form-group"
).
find
(
"label"
).
text
().
replace
(
/
\*
/g
,
''
);
if
(
id
&&
$
(
this
).
attr
(
"required"
)
&&+
value
==-
1
)
{
err
.
push
(
"<p>请选择 "
+
name
+
"</p>"
);
}
});
// var v = Validator.make(data, rules);
// v.mergeAttribute(attributes);
...
...
Please
register
or
login
to post a comment