Hello All,
I am having a problem, mostly concept wise of how, or if I can use client
side Javascript in a server side php statement.
I have a JavaScript function that onChange of a list box, takes the value of
an option and grabs data from a MySQL table. My problem is how do I use the
JavaScript var in my sql statement?
Here is the function.
function Modify_Item_Details(){
var test =
document.forms[0].item.options[document.forms[0].item.selectedIndex].text;
<?
$sql = "Select i.QTY_ON_HAND, u.UNIT from items i INNER JOIN";
$sql.= " units u ON i.Unit_Index = u.Unit_Index";
$sql.= " where i.Item_Index = '".echo "test\n"."'";
$result = mysql_query($sql);
while ($vars = mysql_fetch_array($result)){
echo "document.forms[0].available.text='".$vars[0]."';";
echo "document.forms[0].units.text='".$vars[0]."';";
}
?>
}//end Modify_Item Details
Thanks for any help,
Steve.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php