Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

firefox hash anchor url problem

I have a form on a page, that I'm working on, and (as it's quite a way down), if there's an error, I'm appending the url with

show?comments=2#track_1

where the comments=2 bit is feedback on which field went wrong, and track_1 is the the id of the div in which my form is sitting. This works great in IE (8 at least), but in firefox, the page just sits at the top, without jumping down to the relevant section.

Strangely enough, when I select the URL and push enter in the address bar (i.e. when I go to the address manually, instead of it being generated by the form's validation feedback) it works in firefox!

Anyone have any ideas on what could be going on?

EDIT

n.b. this is happening only with javascript turned off (though this is precisely when I need it to work!)

like image 346
tiswas Avatar asked Mar 24 '11 13:03

tiswas


2 Answers

Your problem sounds like a known bug. Upvote it here.

like image 188
Garnet Avatar answered Sep 21 '22 04:09

Garnet


If you have an autofocus in the page, this can be the reason for the problem. Try removing the autofocus and test.

If it is the reason, upvote the bug in mozilla through this link.

like image 33
Ahmed Avatar answered Sep 21 '22 04:09

Ahmed