E
Elmo Watson
I've inherited a project that has quite a few Table rows - inside each cell,
within the row are a couple of textboxes ("in" and "out"), along with a
"total" label.
Also - this is all within a Content Page/Master Page scenario - I've got the
function inside the Content page, along with the all the items herein
On each row, each of the in and out and total controls have a number
associated with them, like:
In1, Out1, total1
In2,Out2, total2, etc
For each Out textbox, I'm adding the onblur attribute to run this function
I'm trying to create ONE javascript function to add the in and out
textboxes, based the number of the row, which will add the two textbox
values, and put it in the label for that row, but I keep getting errors and
I'm not sure what to do....
I've got a function started but it keeps getting errors, and I'll admit I'm
not a pro with JS. Here's what I've got so far:
function getmiles(num) {
start=document.getElementById("In" + num).getAtribute("value"); // < -
can't find
end=document.getElementById("Out" + num).getAtribute("value");
document.getElementById("Total" + num).getAtribute("value")=start-end;
}
'num' is getting populated, for sure. The main error is
'document.getElementById("..") is null or not an object, plus a couple of
"object expected" errors....
it happens any time I use the structure above (document.getElementById("In"
+ num).getAtribute("value"))
can someone help me here?
within the row are a couple of textboxes ("in" and "out"), along with a
"total" label.
Also - this is all within a Content Page/Master Page scenario - I've got the
function inside the Content page, along with the all the items herein
On each row, each of the in and out and total controls have a number
associated with them, like:
In1, Out1, total1
In2,Out2, total2, etc
For each Out textbox, I'm adding the onblur attribute to run this function
I'm trying to create ONE javascript function to add the in and out
textboxes, based the number of the row, which will add the two textbox
values, and put it in the label for that row, but I keep getting errors and
I'm not sure what to do....
I've got a function started but it keeps getting errors, and I'll admit I'm
not a pro with JS. Here's what I've got so far:
function getmiles(num) {
start=document.getElementById("In" + num).getAtribute("value"); // < -
can't find
end=document.getElementById("Out" + num).getAtribute("value");
document.getElementById("Total" + num).getAtribute("value")=start-end;
}
'num' is getting populated, for sure. The main error is
'document.getElementById("..") is null or not an object, plus a couple of
"object expected" errors....
it happens any time I use the structure above (document.getElementById("In"
+ num).getAtribute("value"))
can someone help me here?