I have a function that takes data inputed into a form field and copies it over to a hidden form field.
The function works with a series of variables named L_QTY0, L_QTY1, L_QTY2 ect.
It is called in the first form field using: copyValue(this)
This all worked very well, however now I have a second set of variables that I need to have this function applied to and it isn't working for me and I don't understand why. I made a new function based on the first one as to not effect the first one at all. The second version of the function and the new call code are listed below as well as the first.
I have been trying unsuc
n = obj.name;
n = n.substring(4,n.indexOf("_"));
n = "L_QTY" + n;
obj.form[n].value = obj.value;
<input type="text" name="item0_qty" size="4" value="0" tabindex="1" onchange="getProductTotal(this,this.form);copyValue(this)" onclick="checkValue(this)" onblur="reCheckValue(this)" />
d = obj2.name;
d = d.substring(4,d.indexOf("_"));
d = "L_DESC" + d;
obj2.form[d].value = obj2.value;
<textarea name="msg0" id="msg0" cols="15" rows="5" value="" onchange="copyValue2(this)"></textarea>