How to set hidden field to zero if radio buttons are not checked

Viewed 153

I have four radio button with name as 2d array.I want to set radio button with same name to zero if others are not checked.Please help i don't have any idea to this problem. These radio buttons are in a while loop.

  A<input type="radio" name="ques['<?php echo $n; ?>'][]" value=1><?php echo $row[3]; ?>
  B<input type="radio" name="ques['<?php echo $n; ?>'][]" value=2><?php echo $row[4];?>
  C<input type="radio" name="ques['<?php echo $n; ?>'][]"  value=3><?php echo $row[5];?>
  D<input type="radio" name="ques['<?php echo $n; ?>'][]"  value=4><?php echo $row[6];?>
  <input type="hidden" name="ques['<?php echo $n; ?>'][]" value="0" />
2 Answers
Related