From 4720e424a25ebd4f1eef62ce8a159dcef1944cc5 Mon Sep 17 00:00:00 2001 From: Bohung Date: Tue, 11 Jan 2022 10:21:11 +0800 Subject: [PATCH 1/2] Fix bug. --- app/views/seminars/_contribute_form.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; From 758d10607a275e1f3ef87d0afc030768a9ecdcb9 Mon Sep 17 00:00:00 2001 From: Bohung Date: Tue, 11 Jan 2022 10:23:50 +0800 Subject: [PATCH 2/2] Fix register page css. --- app/views/seminars/show.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/seminars/show.html.erb b/app/views/seminars/show.html.erb index b461a63..4107704 100644 --- a/app/views/seminars/show.html.erb +++ b/app/views/seminars/show.html.erb @@ -28,6 +28,12 @@ window.alert("<%=notice%>"); <% end %> + <%= form_for @seminar_signup, url: seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup"} do |f| %>