Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can it be done?

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
I have three cells in a table ok?
Code:
<TD><INPUT TYPE=&quot;text&quot; NAME=&quot;cell_one&quot;></TD>
<TD><INPUT TYPE=&quot;text&quot; NAME=&quot;cell_two&quot;></TD>
<TD> --- Result --- </TD>
What I'm looking for is a way to take the values (just numbers) of cells one and two, add them together when the user leaves the second cell (onChange) and display the result in the third cell.

Can it be done? Kevin
slanek@ssd.fsi.com
 
yeah... alright fine... ill give a better answer than that.

you can either give your cell an ID and use innerHTML to write to it, or i'm pretty sure you can get specific table cells by saying rows[0].cells[2] or something... or you could have a layer in the cell that you can write to or whatever.

i suggest the first way, but... it only works in Ie and NS6...

the third way, i think, would only work in NS4.x

anyway... hope that helped more than yes. adam@aauser.com
 
Ponder... can't you give the cell a name, then use JScript to access it?

<td name=cell1> etc.
<td name=cell2> etc.
<td name=result></td>

mytable.result.text = mytable.cell1.text() + mytable.cell2.text()

Rosalie Dieteman
 
Then onChange, just call the function that does that? I assume &quot;mytable&quot; would be replaced with the name of my table, whatever that may be. Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top