I've been scratching my head on this one, but my Javascript skills are rubbish, so I'm struggling on working out how to do this......
I've got a HTML form. A basic version is as follows:
Note, the actual form select options are populated using PHP code pulling data from a database. The data pulled is the "value=xxxxxx" and the actual "Option x £xxx.xx".
Basically, what I want to do is total up the sum of the options selected.
Example:
If someone selects Option 1 for select1, and Option 3 for select2, the total would show £400.00
I want the display to update dynamically, before the form is submitted, so I was thinking JavaScript is the answer.
I've trawled lots of websites and tried a couple of things, but I really am utterly stuck on how to do this, although I'm sure it's perfectly possible.
Someone help me!!
I've got a HTML form. A basic version is as follows:
Code:
<form>
<select name=select1>
<option selected>Please Choose</option>
<option value=option1>Option 1 £100.00</option>
<option value=option2>Option 2 £200.00</option>
<option value=option3>Option 3 £300.00</option>
</select>
<select name=select2>
<option selected>Please Choose</option>
<option value=option1>Option 1 £100.00</option>
<option value=option2>Option 2 £200.00</option>
<option value=option3>Option 3 £300.00</option>
</select>
</form>
Basically, what I want to do is total up the sum of the options selected.
Example:
If someone selects Option 1 for select1, and Option 3 for select2, the total would show £400.00
I want the display to update dynamically, before the form is submitted, so I was thinking JavaScript is the answer.
I've trawled lots of websites and tried a couple of things, but I really am utterly stuck on how to do this, although I'm sure it's perfectly possible.
Someone help me!!


