I have a button that I want to click to copy a line to another line. Since all the fieldnames are the same except for the ending number(1-5), I want to pass the number to the function and build the syntax.
For example, if copyfrom = 1 and copyto = 2 then
my syntax should say document.fishform.weight2 = document.fishform.weight1;
This is my code so far:
<INPUT TYPE="button" value="Copy" onClick="CopyLine(document.fishform.copyfrom.value, document.fishform.copyto.value)">
Line # <INPUT TYPE="text" NAME="copyfrom" SIZE="1" MAXLENGTH="1" VALUE="1" onBlur="ValidLineNum(this)">
to Line #<INPUT TYPE="text" NAME="copyto" SIZE="1" MAXLENGTH="1" VALUE="2" onBlur="ValidLineNum(this)">
<BR><BR>
function CopyLine(FromLine, ToLine) {
var myForm = document.fishform;
myForm.lweight[ToLine] = myForm.lweight[FromLine];
myForm.lcategory[ToLine] = myForm.lweight[FromLine];
}
Thank you for your assistance,
Mickey
For example, if copyfrom = 1 and copyto = 2 then
my syntax should say document.fishform.weight2 = document.fishform.weight1;
This is my code so far:
<INPUT TYPE="button" value="Copy" onClick="CopyLine(document.fishform.copyfrom.value, document.fishform.copyto.value)">
Line # <INPUT TYPE="text" NAME="copyfrom" SIZE="1" MAXLENGTH="1" VALUE="1" onBlur="ValidLineNum(this)">
to Line #<INPUT TYPE="text" NAME="copyto" SIZE="1" MAXLENGTH="1" VALUE="2" onBlur="ValidLineNum(this)">
<BR><BR>
function CopyLine(FromLine, ToLine) {
var myForm = document.fishform;
myForm.lweight[ToLine] = myForm.lweight[FromLine];
myForm.lcategory[ToLine] = myForm.lweight[FromLine];
}
Thank you for your assistance,
Mickey