Page 1 of 1

Converting dropdown menu to radio buttons

Posted: Tue Dec 01, 2009 6:36 am
by thinkingforward
Hi,

I am setting up a shop with the software Opencart and have copied the following code lines which currently generate a drop down menu of prices called from the database:

Code: Select all

                <table style="width: 100%;">
                  <?php foreach ($options as $option) { ?>
                  <tr>
                    <td><?php echo $option['name']; ?>:<br />
                      <select name="option[<?php echo $option['option_id']; ?>]">
                        <?php foreach ($option['option_value'] as $option_value) { ?>
                        <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
                        <?php if ($option_value['price']) { ?>
                        <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
                        <?php } ?>
                        </option>
                        <?php } ?>
                      </select></td>
                  </tr>
                  <?php } ?>
                </table>
However I am trying to change them to radio buttons and wondered if anyone out there could give me some help? I've been trying to adapt the below but no joy.

Code: Select all

<input type="radio" name="blah" value="x" checked="checked"/>Option1
Thank you!