Jump to content


This topic is now archived and is closed to further replies.


Problems with anchor.....

Recommended Posts

Hi everyone.

OK valid xhtml1.1 page, I have a shopping cart that is placed inside a fixed height div (so it scrolls rather than fills the page up).  Each item in the shopping cart is displayed like so.....

<tr class="odd">
<td class="name"><a id="cart5"></a><a href="?section=3&amp;cat=1&amp;id=5" title="Dead Glass">Dead Glass</a></td>
<td class="number">
<a href="?section=3&amp;cat=1&amp;id=5&amp;action=removeitem#cart5" title="Remove Item">-</a>
<a href="?section=3&amp;cat=1&amp;id=5&amp;action=additem#cart5" title="Add Item">+</a>
<td class="cost">£&nbsp;899.99</td>

Now the idea here is that either side of the quantity is a link to add/remove, and when the user clicks one the #cart5 part of teh url will mean that on the resulting page this record will be pushed up to the top of the container, using the (<a id="cart5"> anchor) of the shopping cart (so the user can see it once more.)

This works once only. When the next page is finished processing the link does NOT work again (the url is correct - I have checked) but clicking that url simply does not perform anything.  If I remove the #cartX you can sucessfully add/remove items many times using those links...

Can anyone suggest why this is happening?

Any help would be very much appreciated...

PS: this aspect is imply to make the cart work without js (but I have not put the js in yet!)

Share this post

Link to post
Share on other sites
I'm not sure I understand how this is being performed.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.