diff --git a/app/views/seminars/_contribute_form.html.erb b/app/views/seminars/_contribute_form.html.erb index 4f0613d..b6e1f43 100644 --- a/app/views/seminars/_contribute_form.html.erb +++ b/app/views/seminars/_contribute_form.html.erb @@ -109,7 +109,7 @@ $("form.form-horizontal").submit(function(){ var flag = true; $("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"); flag = false; }else{ @@ -121,11 +121,11 @@ $("form.form-horizontal [type=\"submit\"]").click(function(){ var flag = true; $("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"); flag = false; }else{ - $(v).find("input").removeAttr("required") + $(v).find("input").removeAttr("required"); } }) return flag;