Highlighting a stored value as 'selected'
| From: | Alp | Date: | Tue, 08 Feb 2005 09:14:24 +0000 |
| Subject: | Highlighting a stored value as 'selected' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-208239@lists.php.net to get a copy of this message | ||
Is there an easier way to display/highlight the value stored in the database
for a select option? Such as:
Stored value is 'center'. The statement is:
print '<select name="colalign">';
print '<option value="left">Left';
print '<option value="center">Center';
print '<option value="right">Right';
print '</select>';
I can have 3 sets of the above tied to 'if's but would rather ask for an
easier or better way.
Thanks in advance.
Alp