If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

On form submit that is discarded by JS the bar to save form appear

RESOLVED WONTFIX

Status

()

Toolkit
Password Manager
--
enhancement
RESOLVED WONTFIX
8 years ago
8 years ago

People

(Reporter: Andrei Ermicioi, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13

If having a form which submit is discarded by JavaScript, on pressing submit button the bar with purpose to save the form appear. I thing it doesn't as submit actually have no place. 

Reproducible: Always

Steps to Reproduce:
1. Create a form
2. Write JS code which discard form submit
3. Submit the form
Do you mean the bar "Do you want to remember the password for.. on ...?"
And is the problem still present with the latest version:
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-central/
Version: unspecified → 3.0 Branch
(Reporter)

Comment 2

8 years ago
yes I mean that bar

I just try on the latest version, from the link you provide, the bar steal appear.

here is demo code:

<html>
  <head>
    <title></title>
    <meta content="">
    <style></style>
	
	<script type="text/javascript">
	  function sub() {
		alert("Try to submit");
		return false;
	  }
	</script>
	
  </head>
  <body>
  
  <form action="index.html" method="get" onsubmit="return sub()">
	<input type="password" name="pass" />
	<input type="submit" name="submit" />
  </form>
  
  </body>
</html>
Component: General → Password Manager
Product: Firefox → Toolkit
QA Contact: general → password.manager
Version: 3.0 Branch → Trunk
Yeah, this is unfortunate but required. We listen to a special event that fires right before onformsubmit, because some pages modify/encrypt the password value in *their* onsubmit handler. I don't think there's any event for a successful form submission -- we won't know if there's an onformsubmit handler running after us that might return false.

The side effect here is harmless. The user can just close the bar. If they ignore it and resubmit the form with corrected data (such that the pages onformsubmit validator allows it to proceed, as is the usual reason this stuff is done), then the old bar will be replaced by a new one with the correct login.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.