Closed Bug 512658 Opened 15 years ago Closed 15 years ago

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

Categories

(Toolkit :: Password Manager, enhancement)

x86
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: erani.mail, Unassigned)

Details

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
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
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.