Print Page | Close Window

using the ID tag in a <TD>

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=9154
Printed Date: 29 March 2026 at 9:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: using the ID tag in a <TD>
Posted By: HardwareBob
Subject: using the ID tag in a <TD>
Date Posted: 22 January 2004 at 3:26pm
I've been trying to use the ID= tags inside the <TD id=myName> ones so i can place text from a database on the table, but not using a text/input box. I want to be able to use the document.form1.myName.insertAdjacentText() option, but whenever i try to reference something with the id tag, it comes up with an error saying it doesnt recognise the object or it is null

Does any one know of a better way to insert text from a database into a table not using textarea/text boxes?

Thanks



Replies:
Posted By: michael
Date Posted: 22 January 2004 at 5:35pm

I am sure no javascript buff so I always write the table while looping through the recordsetlike
Response.Write "<td>" & rs("myItem") & "</td>"

I am sure it is possible to do with js, did you give your talble itself and ID also?



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: MorningZ
Date Posted: 23 January 2004 at 11:16pm

might want to do

<td><div id="MyName">blah blah blah</div></td>

instead...

then you can say:
document.getElementById("MyName").innerHTML = 'this text';

actually, that'd probably should work with

<td id="MyName">blah blah blah</td>

as well

and if you need to append new text then:
document.getElementById("MyName").innerHTML += 'this text';



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: HardwareBob
Date Posted: 30 January 2004 at 6:10am
Thanks for the responses, i got it working with this
inside a function

var strSample = document.getElementById("myDiv");
strSample.innerHTML = "text";

it didn't seem to like me just setting the document.getElementById("myDiv").innerHTML = ""

Thankyou



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net