Closed Bug 42616 Opened 24 years ago Closed 24 years ago

form actions with anchor specified (#) do not work

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: andrew, Assigned: pollmann)

References

Details

(Whiteboard: [nsbeta3+]fix in hand; request testcase from contributors-ckritzer;)

I tested some pages containing sort of this HTML code:

<FORM ... ACTION="thispage.phtml#tab">
...
<INPUT TYPE="SUBMIT">

which is allowed AFAIK.

When you press the submit button, the browser jumps to the anchor without
(submitting the form and) reloading the page.
reporter, can you include a test case or a link to a page that demonstrates this 
problem.
I can confirm this, here's a test page:
http://members.home.com/decklin/test.html

It includes a hidden input, because AFAICT nothing in the HTML spec says you
have to reload the page if you already have a cached version for the same (in
this case, empty) query-string.
Status: UNCONFIRMED → NEW
Ever confirmed: true
reassigning 
Assignee: rods → pollmann
Interesting, in Nav I see: test.html?foo=bar
             in Moz I see: test.html#tab?foo=bar
             in IE  I see: test.html?foo=bar#tab

http://www.ietf.org/rfc/rfc2396.txt section 7) says IE is right.
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → M17
*** Bug 43508 has been marked as a duplicate of this bug. ***
This bug is nasty... anything yet?
I have at least a partial fix.  Now when submitting the form we correctly go to 
this URL:

test.html?foo=bar#tab

This is not checked in yet.
Whiteboard: fix in hand
Our behaviour is now like Navigator 4.x's, which I think is correct.  The first 
time we load the page, we get this URL from the server:

http://members.home.com/decklin/test.html

Then clicking on the Submit button we get this URL from the server:

http://members.home.com/decklin/test.html?foo=bar.html

Clicking on the Submit button additional times beyond this will hit the cache 
because the URL+post data are identical.  This is the right thing to do unless 
the server returns an Expires or Pragma: no-cache header.  Marking this fix in 
hand, and will check in the fix I came up with above when the tree opens!
(updating mutiple bugs)

Nominating this bug for beta3 because it is either a crasher or a correctness 
bug and I have a straightforward fix in hand.  This bug fix is small, low risk, 
and can easily be reverted with no side effects.
Keywords: nsbeta3
Marking nsbeta3+
Whiteboard: fix in hand → [nsbeta3+]fix in hand
This fix has been checked in.  Coming up with a test case to assist in
verification...
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
[andrew@andrew.org|Decklin Foster] could one of you guys provide a testcase?  
Decklin, the testcases you provided at http://members.home.com/decklin.test.html 
come back as no longer existing (according to @home).

Thanks!  -ckritzer
Whiteboard: [nsbeta3+]fix in hand → [nsbeta3+]fix in hand; request testcase from contributors-ckritzer;
Still waiting to hear back from contributors...
sorry for the delay. I wrote a minimal testcase and posted it at

http://www.red-bean.com/~decklin/bug42616.html

Clicking submit gives me the very weird result of

http://www.red-bean.com/~decklin/bug42616.html?2616.html#foo

So it appears that this bug is fixed, but there is an unrelated one hanging around.
Updating QA contact.
QA Contact: ckritzer → vladimire
Thanks, Verifying on
 -Windows 98 build 2000-09-25-08-M18
 -Linux RedHat6.2 build 2000-09-19-21-M18

I am seeing the same behaviour though and will look into that.
Status: RESOLVED → VERIFIED
> ------- Additional Comments From Decklin Foster 2000-09-17 20:36 -------
> ... http://www.red-bean.com/~decklin/bug42616.html?2616.html#foo

Decklin, this was actually a typo in my original fix for this bug, causing the
wrong number of characters to be chopped off for the anchor (notice it chopped
off all but the left four characters when it should have chopped off only the
right four characters.

This was corrected when fixing the related bug 57333.  Thanks for the sharp eyes!
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.