Click to See Complete Forum and Search --> : Drop down menu calculator


railanc
07-12-2004, 09:01 AM
Hi there,

I'm currently having problems with some Javascript i'm trying to get to work on my website...

I've got two types of code that I use for various things, and I want to basically have 1 set of code that does the two actions in-one.

I have a set of gift options, chocolates, teddy bear & balloon.

I have these in 3 columns in a table, and under each one is a mini drop down box, with the option to select the item from the box. Selection of more or one items activates some javascript code in a readonly text box - and calculates the totals of the items that they've chosen:

------------
<select name="b" id="b" onChange="document.calc2.shipping.value = parseFloat(document.calc2.a.value) + parseFloat(document.calc2.b.value) + parseFloat(document.calc2.c.value) + parseFloat(document.calc2.d.value)">
<option value="0.00">-----------</option>
<option value="3.50">Chocolates - £3.50</option>
</select>
------------

I've also got somewhere else on the page, code that has a drop down box, full of a list of products. When the user selects one from the list - it confirms their choice in a readonly text box further down the page.

What I want to do, is basically use the code above, to calculate the value of any extra gifts they want, but also SHOW the names of the products they've chosen in a readonly text box, but that the names of the products are separated by comma's.

I don't know how clear i've made that.

Alternatively, if anyone knows how to transfer data from several drop down boxes into a text field, then that would be great!

Thanks in advance,

Rachael