<?php
function Dropdown($selectname, $table, $columnval, $columndisp, $selection)
{
$output = "<select name=\"$selectname\" class=\"formfield\" onchange=\"self.location.r
$output .= "<option value=\"\"";
if($selection == "")
$output .= " selected";
$output .= ">Please Select....</option>\n";
$result = mysql_query("SELECT $columnval, $columndisp FROM $table where $columndisp <> '' ORDER by $columndisp ASC");
while ($myrow = mysql_fetch_object($result
{
$output .= "<option value=\"$myrow->$columnval
if($myrow->columnval == $selection)
$output .= " selected";
$output .= ">$myrow->columndisp</opti
}
$output .= "</select>\n";
}
echo Dropdown("CompanyID","tblC
?>
Main Topics
Browse All Topics





by: wasifgPosted on 2003-12-14 at 21:59:24ID: 9940122
use .form_name .select_na me.value); " in dropdown
value=".$o ptionval' ";
;
onChange="gotoloc(document
and in the value of dropdown embed the value with the location
echo "<option value='".$URL."?drop_down_
if($optionval == $selection)
echo "SELECTED";
echo ">$optiondisp</option>\n";
function gotoloc(location){
if(location != ""){
top.location.href=location
}
}
the value will be available in drop_down_value on next page