Do you have a question? Post it now! No Registration Necessary. Now with pictures!
September 23, 2004, 7:44 am
rate this thread
I've been asked by a client to design what is essentially a very large
order form which draw it's products from a MySQL db using PHP and then
writes them to a table, this i'm fine with.
However, the form must add up quantities and work out discounts based
on the base price and quantity, again, i'm ok with this in either
However, as this information is dynamically sourced and all of the
different fields need naming, i'm a little lossed as to how i can best
Does anyone have any suggesstions?
Client Side Code is included below: -
<html xmlns="http://www.w3.org/1999/xhtml ">
function Total( evt )
total.innerText = parseInt(document.orderform.amount1.value) *
<form name="orderform" id="orderform">
<table align="center" border="1" width="770px" cellspacing="0"
<td><input type="hidden" name="amount1" value="15.4" />
<input type="text" name="amount2" onKeyUp="Total( event )" size="1"