Menu
Hello Everyone
I have a form with a select box ‘item’ where I need to give a value to another field ‘price’ based on the selected option value in the box: i.e.
<form method=’post’ name=’form’>
<select name=’item’>
<option value=’One’ >One</option>
<option value=’Two’>Two</option>
<option value=’Three’>Three</option>
</select>
<input type=”hidden” name=”price” value=””>
</form>
Say,
item One, price value needs to be $10
item Two, price value needs to be $20
item Three, price value needs to be $30
I thought that this would need a fairly simple piece of JavaScript but I can’t seem to get it to work.
Any suggestions?