01-02-2010, 02:07 AM
(12-30-2009, 11:21 AM)Dutchcoffee Wrote: Hello,
I created a HTML form, with a drop down list of "priority levels". These include 'High', 'Medium', 'Low'. When the user submits the form, it displays the info in a table below the form.
What I want to do is when a user selects a priority level, and fills in the rest of the form, and submits it, it will display the correct priority level image. For example, 'High' priority has a "red" dot. 'Medium' a "yellow" dot, and 'Low' a "blue" dot.
I thought about doing something like this...But don't know to implement that into an HTML drop down form.
PHP Code:if($priority == 1)
{
echo "<img src='images/high.png' alt='High' title='High'>";
}
elseif($priority == 2)
{
echo "<img src='images/medium.png' alt='Medium' title='Medium'>";
}
elseif($priority == 3)
{
echo "<img src='images/low.png' alt='Low' title='Low'>";
}
Thanks
Can I make a suggestion, use switch instead of [else]if, just for neater code