quote:
Originally posted by Jimbo
Thanks, but wont that $_POST variable only be retrieved after the form is submitted? or am I being stupid?
I'm trying to make it change instantly, as a new value is entered into the amount box, or if that isn't possible, a button or something to update the total.
And also, I am not trying to round the amount entered, but the amount produced. For example, say someone donated $6.23 (unlikely, yes, but it could happen), that / 0.05 is 124.6. What I would want produced is 125, the nearest whole number. Sorry if I didn't make myself clear.
Sorry, didn't realised you wanted it to calculate on the fly (should've guessed from the title...). As a note, the ceil(..) will produce a rounded value after the calculation.
As for the javascript, shouldn't "result" be either an input as your are trying to change it's "value", or change value to "innerText" so the text is placed within the div?