this is the the code, now here is the final result.... I get one combo box
and
one tex box come up, but they are empty...
DAMN!!!
Any ideas on what Im doing wrong please..
Thanks Again
<?php require_once('. .\library_datab ase\Connections \onlinequote.ph p'); ?>
<?
function select_cases_pr ice ()
{
$qy = "SELECT SellingPrice, Description FROM cases";
$rs = mysql_query ($qy) or die (mysql_error ());
while (mysql_fetch_ar ray ($rs))
{ $select .= "<option value='{$r[0]}'>{$r[0]}</option>\n";
$prices[] = $r{1};
}
return array ($select, $prices);
}
?>
On your web page, call the function.
<? list ($select, $prices) = select_cases_pr ice (); ?> And a bit of JS:
<script>
function showPrice() {
array prices (<? echo $prices ?>);
var i = document.form.i tem.selectedInd ex; document.form.S ellingPrice =
prices[i]; </script>
<select name="Descripti on" onUpdate="showP rice()"> <? echo $select; ?>
</select> <input type="text" name="SellingPr ice" value="">
and
one tex box come up, but they are empty...
DAMN!!!
Any ideas on what Im doing wrong please..
Thanks Again
<?php require_once('. .\library_datab ase\Connections \onlinequote.ph p'); ?>
<?
function select_cases_pr ice ()
{
$qy = "SELECT SellingPrice, Description FROM cases";
$rs = mysql_query ($qy) or die (mysql_error ());
while (mysql_fetch_ar ray ($rs))
{ $select .= "<option value='{$r[0]}'>{$r[0]}</option>\n";
$prices[] = $r{1};
}
return array ($select, $prices);
}
?>
On your web page, call the function.
<? list ($select, $prices) = select_cases_pr ice (); ?> And a bit of JS:
<script>
function showPrice() {
array prices (<? echo $prices ?>);
var i = document.form.i tem.selectedInd ex; document.form.S ellingPrice =
prices[i]; </script>
<select name="Descripti on" onUpdate="showP rice()"> <? echo $select; ?>
</select> <input type="text" name="SellingPr ice" value="">
Comment