how would I get something similar to this:
[code]
function foo() {
var text = document.getElementById("total");
var val1 = parseFloat(document.getElementById("payment").value);
var val2 = parseFloat(document.getElementById(“payment1”).value);var val3 = parseFloat(document.getElementById(“payment2”).value);var val4 = parseFloat(document.getElementById(“payment3”).value);
text.value = val1 + val2 + val3 + val4;
}
</script>[/code]
to post the added numbers to this form
[code]
<?php // Query member data from the database and ready it for display $sql = mysql_query("SELECT * FROM cart where cart_id = '".$_SESSION['complete']."' && product123 !=''"); while($row = mysql_fetch_array($sql)){ $product = $row["product123"]; $price1 = $row["price"]; $id = $row["product_id"]; $qty = $row["quantity"]; $month = date("F Y"); $day = date("d"); $year = date("Y"); $date = date("Y-m-d"); ?> <input name="product[]" type="hidden" value="<?php echo $product; ?>" />
<input name="academy[]" type="hidden" value="<?php echo $academy; ?>" />
<input name="month[]" type="hidden" value="<?php echo $month; ?>" />
<input name="day[]" type="hidden" value="<?php echo $day; ?>" />
<input name="year[]" type="hidden" value="<?php echo $year; ?>" />
<input name="date[]" type="hidden" value="<?php echo $date; ?>" />
<input name="price[]" type="hidden" value="<?php echo $price1; ?>" />
<input name="id[]" type="hidden" value="<?php echo $id; ?>" />
<input name="qty[]" type="hidden" value="<?php echo $qty; ?>" />
<?php
}
?>
do not enter commas (,) or dollar signs ($)
<input name="submit1" type="submit" value="Save Payment" onclick="foo()" />
</p></div> <div class='label1' id='Credit1' style="display:none"> Please enter value given
do not enter commas (,) or dollar signs ($)
<input name="submit2" type="submit" value="Save Payment" onclick="foo()" />
</p></div> <div class='label1' id='Check1' style="display:none"> Please enter value given
do not enter commas (,) or dollar signs ($)
<input name="submit3" type="submit" value="Save Payment" onclick="foo()" />
</p></div> <div class='label1' id='Gift1' style="display:none"> Please enter value given
do not enter commas (,) or dollar signs ($)
<input name="submit4" type="submit" value="Save Payment" onclick="foo()" />
</p></div>
</form>[/code]
hopefully the code logic will make more sense than my words have…sorry.