Jump to content


This topic is now archived and is closed to further replies.


Option Menu Selection As Plain Text

Recommended Posts


I have a registration form with option menus.  Once a member, the  visitor can alter their information.  In order to prevent them from altering some fields, I have stopped the options menus from updating the db but they still appear as option menus.  I would like the option to just appear as fixed text on the page. 

I did this without any problem with the information stored on the db as text but I am having problems with the information stored as numbers.  The options are saved on the db as id numbers which correspond to the options' names (i.e. id# 14 is the id for "Green").  it seems the only way I can have the selected option correctly reappear is in an  options menu. When I try I can only get the first or last option never the option the member chose.

I'd appreciate any suggestions.

The HTML part
  <td align="right" valign="top"><strong>{TXT_COLOURS}</strong></td>
<select name="colours" id="colours" class="textbox">
                                              <!-- BEGIN: colours_opts -->
                                                <option value="{VAL_COLOURS_ID}" {COLOURS_SELECTED}>{VAL_COLOURS_NAME}</option>
                                              <!-- END: colours_opts -->



A view of the db layout

| ID | ABV |            NAME                        |
|  1 | blu |            Blue                            |
|  2 | red |            Red                            |
|  3 | yel |          Yellow                          |

The PHP part


$colours = $db->select("SELECT id, abv, name FROM ".$glob['dbprefix']."Acada_iso_colours ORDER BY name");

for($i=0; $i<count($colours); $i++){

if($colours[$i]['id'] == $acaUserData[0]['colours']){
} else {


$coloursName = "";
$coloursName = $colours[$i]['name'];


$coloursName = substr($coloursName,0,40)."&hellip;";






Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.