Hi I'm reposting this question because for some reason can't post
follow up question to this thread.
What I'm trying to do is put the value and text from a a select in to
a text field and to a hidden field respectfully and the value from
dynamically created hidden fiields in to a text fieldin to a text
field all at the same time
Here's the code as viewed through the browser
<body bgcolor="#FFFFFF" text="#000000" >
<SCRIPT LANGUAGE=JavaScript>
<!--
function ch_price (theForm) {
// this changes the price in the price text field
for (i=0; i < 2; i++){
document.form1.oldprice.value = document.form1.prevprice[i].value;//
the hidden fields
document.form1.price.value =
document.form1.size.options[document.form1.size.selectedIndex].value;
document.form1.Tsize.value =
document.form1.size.options[document.form1.size.selectedIndex].text;
}
}
//-->
</SCRIPT>
<form name="form1" method="post" action="" >
<select name="size" id="size" onChange="ch_price(form1)">
<option selected value="189.00">Select
Size/Colour</option>
<option value="179.00" >95x75cm; 37x29"</option>
<option value=" 89.00" >95x75cm; 37x29"</option>
</select>
<br>
<br>
<input type="hidden" name="prevprice" value="99.00">//hidden fields
that holds value for the oldprice txt field
<input type="hidden" name="prevprice" value="189.00">
<input name="oldprice" class="price" type="text" id="oldprice"
readonly = true value="189.00" size="5" >
<input name="price" class="price" type="text" id="price" readonly =
true value="179.00" size="5" >
<input type="hidden" name="Tsize" value="">
</form>
I've tried to simplify it by taking out any code
T.I.A