확인란 그룹 'locationthemes'를 반복하고 선택한 모든 값으로 문자열을 만들고 싶습니다. 따라서 확인란 2와 4를 선택하면 결과는 "3,8"이됩니다.
<input type="checkbox" name="locationthemes" id="checkbox-1" value="2" class="custom" />
<label for="checkbox-1">Castle</label>
<input type="checkbox" name="locationthemes" id="checkbox-2" value="3" class="custom" />
<label for="checkbox-2">Barn</label>
<input type="checkbox" name="locationthemes" id="checkbox-3" value="5" class="custom" />
<label for="checkbox-3">Restaurant</label>
<input type="checkbox" name="locationthemes" id="checkbox-4" value="8" class="custom" />
<label for="checkbox-4">Bar</label>
http://api.jquery.com/checked-selector/ 여기에서 확인 했지만 이름으로 확인란 그룹을 선택하는 방법에 대한 예는 없습니다.
어떻게 할 수 있습니까?