i have a submit form that consist of 1 group radio button.
<div id="defectclass">
<input id="def1" type="radio" class="defect" name="defect" value="1"/>S
<input id="def2" type="radio" class="defect" name="defect" value="1" />A
<input id="def3" type="radio" class="defect" name="defect" value="1" />B
<input id="def4" type="radio" class="defect" name="defect" value="1" />C
</div>
beside that i have 4 fields at DB table, that is :
- S
- A
- B
- C
i want after submit:
- if def1 are checked send value to field "S"
- if def2 are checked send value to field "A"
- if def3 are checked send value to field "B"
- if def4 are checked send value to field "C"
- if all not checked or null send to all fields value="0"
how do i do that bcoz i've never try this?