Hallo
i m trying to pass combo name to javascript and here is my code
its not working , so how can i do it??
function Fill_Real_Type($type , $lang , $page , $qry_type , $Combo_name){//function to fill real estate type in combo box
$qry = "select * from city where lang = $lang";///fill city name
$qry = mysql_query($qry) or die("Wrong realestate type QRY");
echo'
<select size="1" name="'.$Combo_name.'" onchange="Data(this)">';
while($res = mysql_fetch_array($qry))
if($res['id'] == $type)
echo'<option selected value="'.$res['id'].'">'.$res['name'].'</option>';
else
echo'<option value="'.$res['id'].'">'.$res['name'].'</option>';
echo'</select>
<input name="page" value="'.$page.'" type="hidden" size="15">
<input name="combo_id" type="hidden" size="15">';
}
<script language=javascript>
function Data(t){
doument.forms[0].combo_id.value = document.forms[0].t.value;
alert(doument.forms[0].combo_id.value);
document.forms[0].submit();
}
</script>