I posted this in the PHP forum, but no one replied and I realize this probably belongs here in the JS forum.

I have a table in my database called "emails" that has an "id" row, a "name" row, and an "email" row.

I then run a mysql query to select emails and names and ready them for display in a drop-down menu:
PHP Code:
$sql mysql_query("SELECT * FROM emails ORDER BY name ASC" );
$altOptions "";
while (
$output mysql_fetch_array($sql)) {
$altOptions .= "<option value=\"" $output['email'] . "\">" $output['name'] . "</option>";

I then have this drop-down menu, a tekstbox, and a textarea:
<select name="altusers" class="input" onChange="altemailinsert(document.form.altusers.options[document.form.altusers.selectedIndex].value)">
<option value="">> Select email <</option>

<input type="text" size="40" name="altemail" class="input">
<input type="button" value="Insert" class="button" onClick="newsinsert('<a href=""&quot;mailto:' + document.form.altemail.value + '&quot;>Name</a>');">

<textarea name="newstext" rows="17" cols="96" class="input"><?echo $newstext?></textarea>
What I want is for people to select a name from the drop-down menu, instantly the email of that name is shown in the textbox and then insert it into the textarea. That works almost fine with the code above. If someone selects the name "SitePoint" and the email me@sitepoint.com is shown, then "<a href="mailto:me@sitepoint.com">Name</a> is inserted. That is almost correct.

However, what I want it to insert is this:
"<a href="email.php?user=1">Sitepoint</a>" if the name Sitepoint was selected and that row had id 1 in the database table. I still want the email from that row to be shown in the textbox though.

Is this possible? I can't think of a solution unless an option tag could have two values and that's not possible as far as I know.