Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - using the ID tag in a <TD>
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

using the ID tag in a <TD>

 Post Reply Post Reply
Author
HardwareBob View Drop Down
Newbie
Newbie
Avatar

Joined: 16 January 2004
Location: Australia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote HardwareBob Quote  Post ReplyReply Direct Link To This Post Topic: using the ID tag in a <TD>
    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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
HardwareBob View Drop Down
Newbie
Newbie
Avatar

Joined: 16 January 2004
Location: Australia
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote HardwareBob Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.