I'm looking for what I think is probably a simple javascript calculation form for a web page. It looks like this: --------------------------- Item 1 [Fixed Value] [User Input ] [Fixed Value*User Input] Item 2 [Fixed Value] [User Input] [Fixed Value*User Input] Item 3 [Fixed Value] [User input] [Fixed Value*User Input] [Sum of all (Fixed Value*User Input)] ---------------------------- The only variable supplied by the user would be [User input]. Everything else would be fixed or calculated. [User Input] should default to zero. The 'Sum of" line is very important. I don't care if it calculates dynamically or if you have to hit a "submit" button, but the calculations need to appear on the same page as the input form so that the user can make changes easily multiple times after seeing the results. I have found some spreadsheet and calculator templates, but so far they do either waaay too much or not enough. If anyone can point me to a template, specific tutorial, or have some spare code lying about, I'd be forever grateful. I am javascript illiterate, but if I have the guts I can teach myself how to tweak it from there. Thanks!
Try these, if you need help to customise them just ask. http://javascript.internet.com/forms/confirm-order.html http://javascript.internet.com/forms/order-form.html http://javascript.internet.com/forms/update-order-form-no-page-refresh.html
Thanks. That's the general idea, especially the all-on-one-page. But rather than checkbox selection, I need the user to be able to input a quantity into a text field, because the quantity can vary quite a bit from item to item.
Basically you would need to change <input type="checkbox" to <input type="text" and use onfocus instead of onclick to call the script when the user enters the data in the text box. The basic syntax for adding up the totals will be: item1.value=fixedvalue.value * item1.value; item2.value=fixedvalue.value * item2.value; finaltotal.value = eval(item1.value) + eval(item2.value); Code (markup): Don't forget to use a hidden variable for fixedvalue.