Hello,<br> <br>I have a problem by assigning a value of Quantity in a textarea. When a user clicks a checkbox, the value of checkbox and quantity should appear together in textarea. I get undefined because it seems not function properly. Thank you very much for your time and help!<br> <br><script language="JavaScript"><br><!--<br>function setField(theForm)<br>{<br> theForm.quantity.value = 1;<br> theForm.order.value = "";<br> var val = "";<br> for (var i=0; i<theForm.equipment.length; i++) ¦¦ (var i=0; i<theForm.quantity.length; i++)<br> {<br> if ((theForm.equipment<i>.name.indexOf('equipment') > -1)) ¦¦ ((theForm.quantity<i>.name.indexOf('quantity') > -1))<br> {<br> if (theForm.equipment<i>.checked) ¦¦ theForm.quantity['quantity' + i].value<br> {<br> theForm.order.value += theForm.equipment<i>.value + " - " + theForm.quantity<i>.value + "\n";<br> }<br> }<br> }<br>}<br> <br>file://--><br></script><br> <br><form name="order"><br><input type="checkbox" name="equipment" value="Printer" onClick="setField(this.form)"><br><input type="text" name="quantity" value="1" size=2 onChange="setField(this.form)"><br><br><br><input type="checkbox" name="equipment" value="Mouse" onClick="setField(this.form)"><br><input type="text" name="quantity" value="1" size=2 onChange="setField(this.form)"><br><br><br><input type="checkbox" name="equipment" value="Keyboard" onClick="setField(this.form)"><br><input type="text" name="quantity" value="1" size=2 onChange="setField(this.form)"><br><br><br><textarea onChange="setField(this.form)" name=order value="?" rows=5></textarea><br><br><br></form><br>