echo problem
Posted: Tue Feb 06, 2007 1:06 am
Hi,
cant figure out the syntax for the following, so it can be echoed to the screen. The problem is the select option within the html:
How should it be set out using:
Thanks
cant figure out the syntax for the following, so it can be echoed to the screen. The problem is the select option within the html:
Code: Select all
<select name="choice" value="choice">
<option>Select Choice</option>
<option <?php echo $choice=='product_name' ? 'selected' : ''?> value="product_name">Product Name</option>
<option <?php echo $choice=='description' ? 'selected' : ''?> value="description">Description</option>
</select>Code: Select all
echo '<select name="choice" value="choice">
<option>Select Choice</option>
<option $choice=='product_name' ? 'selected' : '' value="product_name">Product Name</option>
<option $choice=='description' ? 'selected' : '' value="description">Description</option>
</select>';