Forum Moderators: open
For example they pick the base package then add HBO and add on a second receiver for the TV in the bedroom. I would need the script to give them a total based on the packages picked or removed.
If anyone knows of a free script that would be cool too!
Shawn
Once they are done and submit the form a php script could process the info they provided.
Thank you for your reply - the drop down menu idea is what we were thinking of - we dont even need the information sent anywhere. They simply want the visitor to be able to get an idea of what the packages will cost that they want. If the client wants it mailed to them we will probably submit it via the form handler that we use.
You wouldnt happen to know a site that has a java script available similar to this?
Well it shouldn't be too difficult to do. The javascript involved is fairly straight forward. You can put the integer/dollar as the value in each option element in the select box. Then add an onChange event handler that calls a function to add the present value in the textbox with the new option value and change the diplayed total.
You are probably better off adding all the values together every time a drop down is changed, then you don't have to check if they changed an already added value.
[edited by: jatar_k at 1:51 am (utc) on May 30, 2003]
Added: Just checked around a bit, it would probably be listed under a "Calculation" category if there's one available, since it isn't a shopping cart or a catalog.
There's probably something that fits ready made in one of the JS script libraries in the category at ODP - or with doing a search for Javascript (or JS) calculation scripts.