Merge branch 'master' into 'master'

Fix bug.

See merge request spen/seminar!33
This commit is contained in:
chiu 2022-01-11 02:24:34 +00:00
commit df01e1294b
2 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -28,6 +28,12 @@
window.alert("<%=notice%>");
</script>
<% end %>
<style type="text/css">
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
position: relative;
margin: 0;
}
</style>
<%= form_for @seminar_signup, url: seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup"} do |f| %>
<fieldset>