hello all,
I am having difficulties getting the current value of a select box to pass to a function
this is what my code looks like:
PHP Code:<?php
$sql = dbQuery("SELECT PriceCode, Name FROM pricecode ORDER BY PriceCode");
$PriceRetail = $row_rsProduct['PriceRetail'];
$pc = $row_rsProduct['PriceCode'];
$pct = "'".$pc."'";
$Cost = $row_rsProduct['Cost'];
while($row = dbFetchAssoc($sql))
{
?>
<option value="<?php echo $row['PriceCode'];?>" <?php if($row['PriceCode'] == $row_rsProduct['PriceCode']){echo 'selected';}?>><?php echo $row['PriceCode']."|".$row['Name'];?></option>
<?php
} ?>
</select></td>
<td><input size="7" name="Cost" type="text" id="Cost" style="text-align:right" value="<?php echo $Cost;?>"></td>
<td>
<form name="calc">
<a class="calc" style="cursor:pointer" onClick="recalc_prompt(<?php echo $ProductId; ?>,<?php echo $pct; ?>)">Recalc prices</a>
</form>
with this code the variable $pct is only going to be the stored db value - but I need to get the select box current selection value to pass to my function -
Any Ideas??
Thanks


Reply With Quote
Bookmarks