Displaying what link was clicked

  jcotton 15:34 27 Feb 2006

Hi all,

Is it possible to display what link was clickedm in a cell.

I have setup a dummy website click here to help you understand what I mean.

I want it so when link 1 is clicked "link 1" will be displayed in the cell and so forth.


  DrScott 00:13 28 Feb 2006

But if you put an iframe rather than a cell in the body of your page, you can make the link open up in that iframe by changing the 'target' of the link...

I'm not using my PC at the moment so can't play to work out exactly what the code is, but it shouldn't be too tricky.

  Forum Editor 00:15 28 Feb 2006

about what you mean.

  De Marcus™ 00:23 28 Feb 2006

Are you trying to explain that when a person visiting your website clicks on a link they can, whilst viewing that link, see which link took them there by way of a 'previous link' dislplayed in a 'cell' as you put it or hyperlink. Or simply a way of placing a link that tells a visitor which page he/she last visited before coming to the present page?

Or is that the same thing or have I totally missed the point? (woudn't be the first time).

  jcotton 07:54 28 Feb 2006

Hi sorry everyone I should of been more clear.

At the moment when a user clicks either link 1, 2 or 3 the page gets displayed in the iFrame and the cell of the table is empty.

What I want to happen is that when either link 1, 2 or 3 is clicked the page gets displayed in the iFrame BUT in the cell of the table I want it to display what link was clicked.

So for example if link 2 is clicked, the page would be displayed in the iFrame and in the cell the words "link 2" would appear.

Is this possible?

Sorry for any confusion.


  DrScott 10:09 28 Feb 2006

What web design program are you using?

  jcotton 10:26 28 Feb 2006

HI DrScott I am using dreamweaver, coding and design view

  DrScott 11:03 28 Feb 2006

Well in Dreamweaver it's super easy! You just need to use one of DW behaviours (or rather behavior the program being American), i.e. javascript

First, it's probably easier if you use a div layer with a border rather than a cell. But if you really want to use tables, then you need to insert a text form field into the cell.

Then highlight the Link text in DW, in the right hand tool bar go to tag, and select behaviors. Then click the plus sign (add behavior). Choose 'set text' and either layer or text field (depending on what you've chosen). Change the action to onmouseclick, and voila there you have it :)

If you're version doesn't have behaviors then I can post an example and you can copy the code.

There maybe an easier way? I don't know :(

  DrScott 11:03 28 Feb 2006

Ooops I meant 'your' not 'you're' - I've been up all night forgive me!

  DrScott 12:33 01 Mar 2006

So did it work?!

  jcotton 13:18 01 Mar 2006

In the end I did this

<a target="main" onclick="document.getElementById('1').innerHTML = this.innerHTML;" href="start.htm">link 1</a>

<table><tr id="1"></tr></table>

Thanks anyway

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

WPA2 hack: How secure is your Wi-Fi?

Add Depth Of Field to a photo using Tilt Shift Blur in Photoshop

iPhone tips & tricks

Les meilleures tablettes 2017