BILL Carlisle
asked on
Javascript - headers == undefined in a tabular form...
Hi All,
I have a snippit of my html from View Source:
I am try to access the 3565 which is one of the values in a tabular report. I want to get all the amounts in form.
<td headers="CMT_OPTION_000" class="t2data"><input type="hidden" name="f47" value="Option 1" />Option 1</td><td align="right" headers="Price NetVision Member_000" class="t2data">3565</td>
I tried using:
var tds = document.getElementsByTagN ame('td');
for (var i=0; i<tds.length; i++) {
alert(tds(i).headers);
}
Then I was going to get the innerHTML
BUT the alert shows undefined
I have a snippit of my html from View Source:
I am try to access the 3565 which is one of the values in a tabular report. I want to get all the amounts in form.
<td headers="CMT_OPTION_000" class="t2data"><input type="hidden" name="f47" value="Option 1" />Option 1</td><td align="right" headers="Price NetVision Member_000" class="t2data">3565</td>
I tried using:
var tds = document.getElementsByTagN
for (var i=0; i<tds.length; i++) {
alert(tds(i).headers);
}
Then I was going to get the innerHTML
BUT the alert shows undefined
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help..
Incase anyone needs to use headers:
var alltds = theTable.getElementsByTagN
var Option1row = false;
for(var j=0;j<alltds.length;j++){ // for alltds
//alert(alltds[j].headers)
if (alltds[j].headers=="CMT_O
var elemAllC = alltds[j].getElementsByTag
// Check the only 'input' element in the 'td'
if(elemAllC[0].value=='Opt
Option1row=true;
}else{
Option1row=false;
}
} //if my headers
if(!Option1row){ //(!Option1row)
if (alltds[j].headers=="Price
// Get the Row that we are in
var theRow = html_CascadeUpTill(alltds[
// Get all the input elements in that Row.
var elemAll = theRow.getElementsByTagNam
// Go through all 'input' elements to assign Original Value
for(var b=0;b<elemAll.length;b++){
if(elemAll[b].name=="f48")
var original = elemAll[b].value;
//if original is null then innerHTML is the original
if (original==''){ //chkorig
original = alltds[j].innerHTML;
elemAll[b].value = original;
}//chkorig
} //f48
}//elemAll for
var newPrice=stripCharsInBag(o
newPrice=stripCharsInBag(n
newPrice = parseFloat(newPrice)*disco
var strPrice = FormatWithDecimals(newPric
alltds[j].innerHTML = '$'+strPrice;
} // if Price
} //(!Option1row)
} // for LOOP alltds