OK, this one has me a bit bonkers. I have a dynamically generated form, using PHP. I want to use JS to move a value into a field upon selection.
Each row is 5 fields long, the number of rows vary depending upon the query, but the same five fields are gernerated each row.
The value I want to move is split(":"
from the value (value="1.75:butter" )of a select box named selIngredients$i where $i is a counter varable concatenated to selIngredients.
On each iteration of a loop I want to take cost[0] and move it to document.frmAddAndCost.elements["tfItemCost"+ i].
I encounter a not an object error after several loops, which I assume is the counter going beyond the elements array boundary.
Any suggestions would be appreciated.
I know I can re-post the page and have PHP do this, but I'd prefer to use JS in this case.
Thanks in advance,
Pete
Each row is 5 fields long, the number of rows vary depending upon the query, but the same five fields are gernerated each row.
The value I want to move is split(":"
On each iteration of a loop I want to take cost[0] and move it to document.frmAddAndCost.elements["tfItemCost"+ i].
I encounter a not an object error after several loops, which I assume is the counter going beyond the elements array boundary.
Any suggestions would be appreciated.
I know I can re-post the page and have PHP do this, but I'd prefer to use JS in this case.
Thanks in advance,
Pete