Jump to content

[SOLVED] jump to page position on reload


Riparian

Recommended Posts

Scenario :

One page with hundreds of items on it.

Add an Item to the Cart and Page re-loads (Add to Cart uses hyperlink not form).

Re-loaded page stops at the top of the page.

 

Question :

Is there a way that I can force the page to go back to the position it was at when the Add to Cart was clicked rather that scroll down dozens of pages each time.

 

Any help is greatly appreciated  :D 

Link to comment
https://forums.phpfreaks.com/topic/174764-solved-jump-to-page-position-on-reload/
Share on other sites

For those interested the named anchor did work... Thank Knitso

 

Where I was going wrong was having the hyperlink Add to Cart like this

 

(a href.....etc ) currentprogram.php#nametogot?var1=xx&var2=xx

 

It should have been

 

(a href.....etc ) currentprogram.php?var1=xx&var2=xx#nametogot

 

Note the name anchor after the variables

 

The <a name="<?=$row[model_number]?>"></a> was defined above the Add to Cart hyperlink

 

Thanks for the interest

Archived

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

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