forked from spen/seminar
Fix bug.
This commit is contained in:
parent
c5f2dbfb35
commit
4720e424a2
|
@ -109,7 +109,7 @@
|
||||||
$("form.form-horizontal").submit(function(){
|
$("form.form-horizontal").submit(function(){
|
||||||
var flag = true;
|
var flag = true;
|
||||||
$("div[required=\"required\"]").each(function(i,v){
|
$("div[required=\"required\"]").each(function(i,v){
|
||||||
if($(v).find("input:checked").length == 0){
|
if($(v).find("input").length != 0 && $(v).find("input:checked").length == 0){
|
||||||
$(v).find("input").attr("required","required");
|
$(v).find("input").attr("required","required");
|
||||||
flag = false;
|
flag = false;
|
||||||
}else{
|
}else{
|
||||||
|
@ -121,11 +121,11 @@
|
||||||
$("form.form-horizontal [type=\"submit\"]").click(function(){
|
$("form.form-horizontal [type=\"submit\"]").click(function(){
|
||||||
var flag = true;
|
var flag = true;
|
||||||
$("div[required=\"required\"]").each(function(i,v){
|
$("div[required=\"required\"]").each(function(i,v){
|
||||||
if($(v).find("input:checked").length == 0){
|
if($(v).find("input").length != 0 && $(v).find("input:checked").length == 0){
|
||||||
$(v).find("input").attr("required","required");
|
$(v).find("input").attr("required","required");
|
||||||
flag = false;
|
flag = false;
|
||||||
}else{
|
}else{
|
||||||
$(v).find("input").removeAttr("required")
|
$(v).find("input").removeAttr("required");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return flag;
|
return flag;
|
||||||
|
|
Loading…
Reference in New Issue