PDA

View Full Version : Picking up href from within table column


djfenom
06-26-2002, 11:11 AM
I am currently logging down all of the websites that we deal with in one large table, the table has columns covering IP Number, Domain, Notes and an option to visit the site.

What I am trying to do is have the last column, called Visit, enable you to click on the link and then go off to that particular site. However, instead of just manually inputting each of the links, I was wondering if I could somehow pickup the address from the Domain column and use this as the link.

This would save time every time I add a new domain, instead of entering in the domain twice, I would just enter it into the domain column, say putting www.website.com and then in the Visit column, I could pick up this link and put it into the href.

Hope somebody can help.

Cheers

Chris

djfenom
06-26-2002, 02:44 PM
Thanks for that Dave, it works great. However the column named Domain is not actually a link, it just has the domain written down without a href.

Is there anyway of picking it up from that?

tamienne
06-26-2002, 02:53 PM
Wrap the domain column with a div and id.

<DIV ID="domain1">domain url</DIV>

then use innerHTML to get the domain url. I don't think NS4 supports innerHTML though.

djfenom
06-26-2002, 03:03 PM
Thanks tamienne but I'm not really sure how to do that, I'm only bothered about IE.

Thanks

Chris.

djfenom
06-27-2002, 09:10 AM
Thanks Dave, but all I'm getting is a syntax error, maybe it would be easier if I showed you exactly what I'm doing:

http://www.pitch.co.uk/test

Vladdy
06-29-2002, 12:41 AM
I suggest a different approach:

Construct the whole table dynamically from a data array - not only will you save time adding new domain names, you will also save time by not having to "<TR><TD>" and such.

Check my version of the code that does dynamic tables construction and manipulation at:
Vladdy's Tables (http://www.vladdy.net/WebDesign/DOM_Tables.html)

PM or E-mail me if you would like to adapt my code to your project.