Jump to content

links in tables opening in _self and _blank!


niccio
 Share

Recommended Posts

Kind of pulling my hair out over this one. I have a table on my site and the cells and text in the cells link to different places. The problem is that the hyperlinks open in the same window and in a new window! I'm guessing it's some small issue with the coding, but I'm going crosseyed figuring it out!

<TABLE CLASS="Table1"><TR> <TD onclick="window.location.href='//kahspkfs01/bco/Accordian/Structure/Link_arb_forums/index.htm/'" target="_blank"><a class="c1" href="//kahspkfs01/bco/Accordian/Structure/Link_arb_forums/index.htm/" target="_blank">Arbitration Forums</a></TD> </TR><TR> <TD onclick="window.location.href='https://www.cporderpoint.com/orderpoint/'" target="_blank"><a class="c1" href="https://www.cporderpoint.com/orderpoint/" target="_blank">Choicepoint</a></TD> </TR><TR> <TD onclick="window.location.href='https://www.armsweb.com/armslogon/'" target="_blank"><a class="c1" href="https://www.armsweb.com/armslogon/" target="_blank">ARMS</a></TD>   </TR></TABLE>

p.s. anyone know why clicking on "insert: Center, Insert: CODEBOX, etc." on the side of my screen doesn't work in this forum? Is it an IE8 issue?

Edited by niccio
Link to comment
Share on other sites

The onclick handler in each <TD> element causes the new location to open in the current window. A <TD> element cannot have a target attribute, so that is ignored. The target attribute in your <a> element causes the link to open in the new window, since clicking on the link also registers as a click on the cell.There is no reason at all to have that onclick handler in your <td> elements. You're doing the work twice. Unless you have some goal I can't figure out, clicking on the text link should be enough.

Link to comment
Share on other sites

The only issue I'm running into with clicking on the text is that the cursor has to be exactly positioned on the text (which for some reason is difficult for the employees). The result I was going for is to be able to click anywhere in the cell and open the link in a new window.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...