I have a total field that I just want to appear as normal text. It is in a table that can have unlimited rows.
My environment is ASP using Javascript for client side edits.
I have the RowNumber of the <TR> so can access the nodes.
To reduce the problem,
I've tried using "alert()" and set up an anchor (<a href=...>) and am trying to display the value, as follows:
(note: this is paraphrased, this isn't the actual code I'm running, excuse any slight typo, but this gives the idea)
function fnDisplayIt(objIn, rowNumIn){
//Recreate as local objects for better referencing.
var obj=objIn;
var rowNum=rowNumIn;
// this will get an error saying "obj.parentNode not object"
alert(obj.parentNode.nodeName);
// this will say "undefined"
alert(obj.nodeName);
// I can't figure out any container to assign "txtMyField"
// to. Tried "<tt id=txtMyField name=txtMyfield>
alert(document.form1.txtMyField(rowNum).value);
}
.
.
.
var rowNum=0;
<% do until rst.eof%>
<td><a href="javascript:fnDisplayIt(this,rowNum)">
<%="MyTotalField"%></a>
rowNum=rowNum+1;
.
.
.
I'm pretty confused about when nodes will have values and when they will have parents.
It appears that only INPUT controls can have values that are referenced by the "document.form..." model. However, I thought that the DOM model allowed full navigation of the table tree, giving access to all elements including text values.
In case you're wondering, this is an Inventory Maintenance screen where they see about 50 inventory items at a time. They go down the screen making multiple changes before pressing submit. I do all sorts of recalculating, automatic populating, color coding for lines changed, etc. BEFORE they press submit. So this program does a lot of client JavaScript value changes.
Of course, the easy answer is to make everything an input field, and simply disable the ones I don't want them to change. I'm just wondering if that's the only option since I'm no good at using STYLE and I can't figure out how to eliminate the Boxes and make things look appropriate for total fields that don't allow user edits (ie: no box).
My environment is ASP using Javascript for client side edits.
I have the RowNumber of the <TR> so can access the nodes.
To reduce the problem,
I've tried using "alert()" and set up an anchor (<a href=...>) and am trying to display the value, as follows:
(note: this is paraphrased, this isn't the actual code I'm running, excuse any slight typo, but this gives the idea)
function fnDisplayIt(objIn, rowNumIn){
//Recreate as local objects for better referencing.
var obj=objIn;
var rowNum=rowNumIn;
// this will get an error saying "obj.parentNode not object"
alert(obj.parentNode.nodeName);
// this will say "undefined"
alert(obj.nodeName);
// I can't figure out any container to assign "txtMyField"
// to. Tried "<tt id=txtMyField name=txtMyfield>
alert(document.form1.txtMyField(rowNum).value);
}
.
.
.
var rowNum=0;
<% do until rst.eof%>
<td><a href="javascript:fnDisplayIt(this,rowNum)">
<%="MyTotalField"%></a>
rowNum=rowNum+1;
.
.
.
I'm pretty confused about when nodes will have values and when they will have parents.
It appears that only INPUT controls can have values that are referenced by the "document.form..." model. However, I thought that the DOM model allowed full navigation of the table tree, giving access to all elements including text values.
In case you're wondering, this is an Inventory Maintenance screen where they see about 50 inventory items at a time. They go down the screen making multiple changes before pressing submit. I do all sorts of recalculating, automatic populating, color coding for lines changed, etc. BEFORE they press submit. So this program does a lot of client JavaScript value changes.
Of course, the easy answer is to make everything an input field, and simply disable the ones I don't want them to change. I'm just wondering if that's the only option since I'm no good at using STYLE and I can't figure out how to eliminate the Boxes and make things look appropriate for total fields that don't allow user edits (ie: no box).