Jump to content

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.....

[code]
<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>
1
<a href="?section=3&amp;cat=1&amp;id=5&amp;action=additem#cart5" title="Add Item">+</a>
</td>
<td class="cost">£&nbsp;899.99</td>
</tr>
[/code]

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!)
Link to comment
https://forums.phpfreaks.com/topic/25284-problems-with-anchor/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.