체크 박스가 많은 매우 긴 폼을 보내야합니다. 다음과 같이 영역별로 그룹화되어 있습니다.HTML 양식이 체크되지 않은 체크 박스를 전송합니다
<fieldset>
<legend>Whatever1</legend>
<div class="checkbox-list">
<label class="checkbox inline"><input type="checkbox" name="Hobbies" value="Arts"> Arts</label>
<label class="checkbox inline"><input type="checkbox" name="Hobbies" value="Bars"> Bars</label>
<label class="checkbox inline"><input type="checkbox" name="Hobbies" value="Books"> Books</label>
(more items)
</div>
</fieldset>
<fieldset>
<legend>Whatever2</legend>
<div class="checkbox-list">
<label class="checkbox inline"><input type="checkbox" name="Interests" value="Architecture"> Architecture</label>
<label class="checkbox inline"><input type="checkbox" name="Interests" value="Audio"> Audio/vídeo</label>
<label class="checkbox inline"><input type="checkbox" name="Interests" value="Business"> Business</label>
(more items)
</div>
</fieldset>
양식이 훨씬 길지만 아이디어를 얻을 수 있습니다.
을 사용하면 내 django 백엔드는 Hobbies
배열로 그룹화 된 모든 체크 박스를 수신합니다. 이는 매우 편리하지만 체크되지 않은 체크 박스도 알아야합니다. hidden input trick에 대해 알고 있지만 체크 박스 그룹화의 일부로 value
필드를 사용하므로 유용하지 않습니다.
무엇을 할 수 있습니까?
두 번째 제안이 내 문제를 해결했습니다. 고맙습니다. –