|
Posted by IchBin on 07/12/06 05:49
This is very new to me, scripting languages. I am trying to get the
/select id off of a dropdownlist, which really does not drop down and is
more like a flat list??, at an onchange event. Then move it into a php
var to retrieve different data from db. Not that it matters but I load
about 1200 items in to the list and was surprised how fast it is.
Could some one give me some direction?
//
// Handle the data coming back <OPTION VALUE="0">Choose a Group
echo "<FORM NAME=author>";
echo "<SELECT NAME=author_pk SIZE=20 COLS=20 ONCHANGE=getPK()>";
while ($rows = mysql_fetch_object($result)) {
echo "<OPTION VALUE=".$rows->id.">".
$rows->TITLE." ".
$rows->lastname.", ".
$rows->firstname.
$rows->middlename.
$rows->SUFFIX.
"</OPTION>";
}
echo "</SELECT>";
echo "</FORM>";
echo "<script language=Javascript>";
echo "function getPK() {";
<? $location ?> =
"document.author.author_pk.options[document.author.author_pk.selectedIndex].value
";
echo "}";
echo "</script>";
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
[Back to original message]
|