Closed Bug 48954 Opened 24 years ago Closed 22 years ago

form submission broken on relative action URIs with hashmarks or non-standard ports [form sub]

Categories

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

Other
All
defect

Tracking

()

VERIFIED WORKSFORME
Future

People

(Reporter: johnnyb, Assigned: alexsavulov)

References

()

Details

(Keywords: testcase, Whiteboard: [rtm-][nsbeta3-])

if the action attribute of the form tag points to the current page and has a
hash in it, when the submit button is clicked on, it just looks for the anchor
within the current page, instead of actually submitting the form to the server. 
For example:

<form action="this.cgi#here">
<input type=submit>
</form>

If the page you are looking at is called "this.cgi", clicking on the submit
button will not submit the form.  This behavior occurred on M17 and recent
nightly builds.  The Aug 13 build, however, would only exhibit the behavior if
the anchor was different than the one in the location bar.  For example, if the
location bar had "this.cgi#hello" and the action attribute had
"this.cgi#goodbye", the form would be submitted.  If the location bar and the
action attribute were the same, the form would not be submitted.  In the URL
given, there is a whole set of test cases you can try to see what breaks in the
current release.
confirming
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
reassigning
Assignee: rods → pollmann
What is the expected behaviour?  Should the form always be submitted in each
case?  It appears that is what Nav 4.x does...
For a real-world example of the problem, go to

http://www.wolfram.com/company/opportunities/openings.cgi

and try to click on the arrows in both Nav 4 and Mozilla.
46198 seems similiar to this
PDT: Nominating for nsbeta3+
Reason: Perceived data loss;
Keywords: nsbeta3
Marking nsbeta3-. Just not enough time to fix this problem before nsbeta3.
Whiteboard: [nsbeta3-]
I think there are more implications with this bug as one might see at first
glance....
The bug is _not_ restricted to ACTION URIs with relative targets to the same
page. Instead, ANY relative ACTION URI will also break form submission, if the
server runs on a non-standard port.

The typical behaviour I've noticed is, that Mozilla just does something
(indicated by the busy pointer) for 3 or 4 seconds, but nothing happens.

This bug can be caused by _any_ relative URI in the ACTION attribute. I've
seen this behaviour also with invalid ip:port combinations, but can't reproduce
it in the moment.

I've not found a workaround for this, setting BASE doesn't help, changing the
METHOD attribute is also without any effect, so I updated the summary in the
hope someone at Mozilla helps to fix this before RTM.

Keywords: rtm
Summary: form action= URLs with hashes (anchors) in them → form submission broken on relative action URIs with hashmarks or nstd ports
Updating QA contact.
QA Contact: ckritzer → vladimire
Summary: form submission broken on relative action URIs with hashmarks or nstd ports → form submission broken on relative action URIs with hashmarks or non-standard ports
Whiteboard: [nsbeta3-] → [nsbeta3-][NEEDINFO]
Need info: Why would someone use a # in this context?  How common is this used?

Changed nstd to non-standard in summary
CC'ing ekrock
The real-world example posted by Jonathan Bartlett 2000-08-16 07:08 works for me
with todays build tested on WINNT and Linux.

The other problem reported by Matthias Kerkhoff 2000-09-20 17:38 should be
reported as a separate bug.

Marking rtm-, since there isn't an example of a real world problem and there
isn't enough time before rtm to fix the remaining issues in this bug.
Whiteboard: [nsbeta3-][NEEDINFO] → [rtm-][nsbeta3-][NEEDINFO]
Re-reported as #55906.
Removing [NEEDINFO] from status
Whiteboard: [rtm-][nsbeta3-][NEEDINFO] → [rtm-][nsbeta3-]
Mostly fixed in M18 - if you go to

http://members.wri.com/johnnyb/mozilla/formanchor.cgi

you will find that all of the buttons work reliable except the second button,
which will work the _first_ time, but further clicks do not resubmit the form.
Keywords: nsbeta1
Setting milestone to future
Target Milestone: --- → Future
worksforme now.

The second testcase in <http://members.wri.com/johnnyb/mozilla/formanchor.cgi>
doesn't show any problem.

Build: 2001043008
Marking worksforme per above comments.  Thank you Koike!
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
The GET buttons in the testcase are still working only once... reopening
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Bulk reassigning form bugs to Alex
Assignee: pollmann → alexsavulov
Status: REOPENED → NEW
Summary: form submission broken on relative action URIs with hashmarks or non-standard ports → form submission broken on relative action URIs with hashmarks or non-standard ports [form sub]
Blocks: 104166
The culprit is the loader.  When we send a GET request, it acts just like a link
click or typing in the URL bar: it first checks to see if the URL is an anchor
in that document.  The proper solution to this is to add a new load type or some
load flags that say hey, this ia a form submit, we need you to load anyway.  Or
maybe said flag already exists.

Current code that actually short-circuits for anchors is
http://lxr.mozilla.org/seamonkey/source/docshell/base/nsDocShell.cpp#4089.
There's no easy way of doing this one, as far as I can tell.  We'll have to
either modify OnLinkClick() or add a new submit form event type that can load
the URI with proper flags.
wfm 2002-10-18-08-trunk
Status: NEW → RESOLVED
Closed: 23 years ago22 years ago
Resolution: --- → WORKSFORME
verifying build 2003-02-12-08-trunk
Status: RESOLVED → VERIFIED
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.