Commit a4d55f5c48b990e09ea425e87b18e9954a2f4049
1 parent
7e84ddcd
Exists in
master
and in
29 other branches
Fix field checkboxes
The hidden fields must come before the check boxes
Showing
3 changed files
with
9 additions
and
9 deletions
Show diff stats
app/views/features/_manage_community_fields.rhtml
... | ... | @@ -14,16 +14,16 @@ |
14 | 14 | <td><label for="community_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
15 | 15 | |
16 | 16 | <td> |
17 | - <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %> | |
18 | 17 | <%= hidden_field_tag "community_fields[#{field}][active]", false %> |
18 | + <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %> | |
19 | 19 | </td> |
20 | 20 | <td> |
21 | - <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %> | |
22 | 21 | <%= hidden_field_tag "community_fields[#{field}][required]", false %> |
22 | + <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %> | |
23 | 23 | </td> |
24 | 24 | <td> |
25 | - <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %> | |
26 | 25 | <%= hidden_field_tag "community_fields[#{field}][signup]", false %> |
26 | + <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %> | |
27 | 27 | </td> |
28 | 28 | |
29 | 29 | </tr> | ... | ... |
app/views/features/_manage_enterprise_fields.rhtml
... | ... | @@ -14,16 +14,16 @@ |
14 | 14 | |
15 | 15 | <td><label for="enterprise_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
16 | 16 | <td> |
17 | - <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %> | |
18 | 17 | <%= hidden_field_tag "enterprise_fields[#{field}][active]", false %> |
18 | + <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %> | |
19 | 19 | </td> |
20 | 20 | <td> |
21 | - <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %> | |
22 | 21 | <%= hidden_field_tag "enterprise_fields[#{field}][required]", false %> |
22 | + <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %> | |
23 | 23 | </td> |
24 | 24 | <td> |
25 | - <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %> | |
26 | 25 | <%= hidden_field_tag "enterprise_fields[#{field}][signup]", false %> |
26 | + <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %> | |
27 | 27 | </td> |
28 | 28 | |
29 | 29 | </tr> | ... | ... |
app/views/features/_manage_person_fields.rhtml
... | ... | @@ -13,16 +13,16 @@ |
13 | 13 | <tr> |
14 | 14 | <td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
15 | 15 | <td> |
16 | - <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %> | |
17 | 16 | <%= hidden_field_tag "person_fields[#{field}][active]", false %> |
17 | + <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %> | |
18 | 18 | </td> |
19 | 19 | <td> |
20 | - <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %> | |
21 | 20 | <%= hidden_field_tag "person_fields[#{field}][required]", false %> |
21 | + <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %> | |
22 | 22 | </td> |
23 | 23 | <td> |
24 | - <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %> | |
25 | 24 | <%= hidden_field_tag "person_fields[#{field}][signup]", false %> |
25 | + <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %> | |
26 | 26 | </td> |
27 | 27 | </tr> |
28 | 28 | <% end %> | ... | ... |