Jump to content

show the Selected options in the edit page (help please)


Darkwoods

Recommended Posts

hello

 

i have a multitiple  dropdown box in the edit page and i would like to how the selected options in the edit page

 

here is the code:

 echo '<input type=hidden name="type_specialitydoc" value="multiselect">
	<select size = "15" id="value_specialitydoc" name="value_specialitydoc[]" multiple > 
	';

$dbquery2 = mysql_query("SELECT * FROM specialty_categories");
while ($dbrow2 = mysql_fetch_array($dbquery2))
{
$id1     = $dbrow2['id'];
$catname = $dbrow2['catname'];
/*	echo '<option style="font-weight:bold; color:#CCCCCC" value="'. $id1 .'"disabled="disabled">-'. $catname . '</option>'; */
echo '<optgroup label="'. $catname . '">'; 

$dbquery = mysql_query("SELECT * FROM specialty where speccat = $id1 ORDER BY name;");

while ($dbrow = mysql_fetch_array($dbquery))
{ 
	$id   = $dbrow['id'];
	$name = $dbrow['name'];

echo '	<option value="' .$id .'">    ' . $name .'</option>	';
}
}

echo '</SELECT>';	

 

 

thats how my database looks like:

Table1: Maintable
Column: id, field1, field2, SPECIALTY <<< (the values of the id from table specialty .catvalue)

Table2: Specialty
Column: id, name, catvalue

Table3: Specialty_categories
Column: id, catname

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.