Expand|Select|Wrap|Line Numbers
- <table>
- <tr>
- <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td>
- </tr>
- <tr>
- <td><input name="spec2" type="checkbox" value="1" tabindex="12" /><label id="label">Building Construction</label></td>
- </tr>
- <tr>
- <td><input name="spec3" type="checkbox" value="2" tabindex="13" /><label id="label">Dam Construction</label></td>
- </tr>
- <tr>
- <td><input name="spec4" type="checkbox" value="3" tabindex="14" /><label id="label">Power & Telecommunication Works</label></td>
- </tr>
- <tr>
- <td><input name="spec5" type="checkbox" value="4" tabindex="15" /><label id="label">Road Construction</label></td>
- </tr>
- <tr>
- <td><input name="spec6" type="checkbox" value="5" tabindex="16" /><label id="label">Others</label></td>
- </tr>
- </table>
Expand|Select|Wrap|Line Numbers
- if($_POST['spec1']==0){ $spec1="1";} else { $spec1="0"; }
- if($_POST['spec2']==1){ $spec2="1";} else { $spec2="0"; }
- if($_POST['spec3']==2){ $spec3="1";} else { $spec3="0"; }
- if($_POST['spec4']==3){ $spec4="1";} else { $spec4="0"; }
- if($_POST['spec5']==4){ $spec5="1";} else { $spec5="0"; }
- if($_POST['spec6']==5){ $spec6="1";} else { $spec6="0"; }
Any help in this situation could be a great help! Kindly correct my code if necessary or kindly help me how to insert multiple checkbox values in different fields of a table.