확인란과 텍스트 영역을 사용하는 양식이 있습니다. 양식을 제출하기 위해 갈 때 텍스트 영역의 데이터가 아닌 체크 박스 (1 또는 0)의 값을 제출합니다. 아래는 제 양식입니다.여러 필드에서 동일한 값을 갖는 레일스 양식
<%= form_for(:add_kids) do |kid|%>
<div class="kidsname">
<%= kid.text_field :first_name, placeholder: "First", class: "name" %>
<%= kid.text_field :last_name, placeholder: "Last", class: "name" %>
</div>
<br>
<div class="allergens">
<h4>Allergens/Asthma:</h4>
<div class="allergens-list">
<ul>
<li>
<%= kid.check_box :soy %>
<%= kid.label :soy %>
<%= kid.check_box :peanuts %>
<%= kid.label :peanuts %>
<%= kid.check_box :wheat %>
<%= kid.label :wheat %>
</li>
<li>
<%= kid.check_box :milk %>
<%= kid.label :milk %>
<%= kid.check_box :nuts %>
<%= kid.label :nuts, "Tree Nuts" %>
<%= kid.check_box :eggs %>
<%= kid.label :eggs %>
</li>
<li class="otherNeeds">
<%= kid.check_box :other, {class: "other"} %>
<%= kid.label :other, "Other Needs" %>
<div class="concernsContainer">
<h3>Please type your kid's needs or concerns</h3>
<div class="concernsBox">
<%= kid.text_area :other, placeholder: "Type here...", maxlength: 500, disabled: 'disabled' %>
</div>
</div>
</li>
</ul>
</div>
</div>
<% end %>
여기에 질문이 없습니다 ... – tyler
왜 텍스트 영역이 비활성화되어 있습니까? – Hesham
jQuery onclick 이벤트가 발생할 때까지는 사용할 수 없습니다. 질문은 텍스트 상자가 아닌 체크 박스에서 값을 쓰는 이유는 무엇입니까? 고맙습니다. –