Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Here everything goes fine but error is when i am keeping the below text field data doesnot save into db(selecting the radio button field).but if i am removing the text field.everything goes fine.two type of field is present.(radio,text).i think which may cause problem.plz suggest me.



HTML
<tr id="color" style="height:77px;">
                              <td width="20%"><input type="radio" name="data[Order][color]" id="radio33" class="css-checkbox" value="1" <?php if($order['Order']['color']=='1'){ ?> selected="selected" <? } else{ echo "";} ?>/><label for="radio33" class="css-label"  style="margin-top:0px; width:100%">Full color Font  black</label></td>
                              <td width="20%"><input type="radio" name="data[Order][color]" id="radio34" class="css-checkbox" value="2" <?php if($order['Order']['color']=='2'){ ?> selected="selected" <? } else{ echo "";} ?>/><label for="radio34" class="css-label"  style="margin-top:0px; width:100%">Full color Font black </label></td>
                              <td width="20%"><input type="radio" name="data[Order][color]" id="radio35" class="css-checkbox" value="3" <?php if($order['Order']['color']=='3'){ ?> selected="selected" <? } else{ echo "";} ?>/><label for="radio35" class="css-label"  style="margin-top:0px; width:100%">Full color Font black </label></td>
                              <td width="20%"><input type="radio" name="data[Order][color]" id="radio36" class="css-checkbox" value="4" <?php if($order['Order']['color']=='4'){ ?> selected="selected" <? } else{ echo "";} ?>/><label for="radio36" class="css-label"  style="margin-top:0px; width:100%"> Black & white</label></td>
                              <td width="20%"><input type="text" name="data[Order][color]" id="radio37" placeholder="Enter Color" style="width:100%;
                              border:none;" /></td>
                        </tr>
Posted
Comments
Ishpreet Kaur 24-Feb-15 11:16am    
Ya, its true. when you remove textbox, then it will work correct. Actually, you are using same name, that is ("data[Order][color]") for both radio button and textbox fields. If you give different name to radio button and textbox fields, then it will work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900