Jump to content


Option Menu Selection As Plain Text

  • Please log in to reply
No replies to this topic

#1 spare

  • Members
  • PipPip
  • Member
  • 10 posts

Posted 27 August 2006 - 08:48 PM


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;";


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users