Open Bug 655308 Opened 13 years ago Updated 7 months ago

onsubmit - when press backspace in a alert box and return false, the form is submit anyway

Categories

(Toolkit :: Content Prompts, defect)

defect

Tracking

()

People

(Reporter: diego_viper_007, Unassigned, NeedInfo)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

This is de code:
---------------------------------------------------------------
<?php
if($_POST)
{
	echo "DataGrid";
}
?>
<html>
	<body>
	<head>
	<script type="text/javascript">
		function test(val)
		{
			if(val == 1)
			{
				alert("If you press the backspace -> Firefox 4 BUG!!!");
				return false;
			}
			else
			{
				return true
			}
		}
	</script>
	</head>
	<table id='table_form'>
		<form id='form_tag' name="formulario" action="index.php" method="POST" onsubmit="javascript:return test(1)">
		<tr><td>Field 1: </td><td><input type='text' name='f1'></td></tr>
		<tr><td>Field 2: </td><td><input type='text' name='f2'></td></tr>
		<tr><td colspan=2 style='text-align:center;'><input type='submit' value='Search'></td></tr>
		</form>
	</table>
	</body>
</html>
---------------------------------------------------------------

Reproducible: Always

Steps to Reproduce:
1.Click "search button"
2.When the alert is appear, press backspace

Actual Results:  
Show the bug: The form is submit anyway

Expected Results:  
form is NOT submit

I test this form in Opera, Google Chrome, Safari, Netscape, Internet Explorer and FIREFOX 3.6 and this problem does not occur. But i test this form in Firefox(version 4.0.1) in differents pcs an the result is equal; the form is submit anyway
Group: core-security
Component: Security → General
QA Contact: firefox → general
Version: unspecified → 4.0 Branch
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5? Does the issue occur with the latest nightly? http://nightly.mozilla.org/
Just tried the latest nightly and this is still an issue. With one of the new javascript alert boxes open, if you hit "Backspace", it does the same as a browser back button. Particularly bad if the alert is telling you something like "the text you entered is too long, please shorten your response". In IE, backspace does nothing and the user has to click "OK" to get past the alert.
Version: 4.0 Branch → 8 Branch
Would you be willing to track down a regression range? http://harthur.github.com/mozregression/

If you find out when it broke, it makes it a lot easier to get it fixed.
Diego -> Is this still happening in Firefox 11?
No, in "Firefox 11" does not occur. But in Firefox 4 yes. Why the 'status' of this bug continued as 'unconfirmed'?
Just reproduced with FF10, then upgraded to FF11. Still an issue there, using the test HTML provided by Diego. Not an issue in Chrome using the same test file. Backspace does the same thing as IE with the alert which is nothing.
Diego, Do you know how to get a regression range?
Severity: critical → major
Flags: needinfo?(diego_viper_007)
Attached file Reporter's testcase
I can reproduce this bug using the reporter's testcase. This regressed with tab-modal alerts (bug 59314).
Flags: needinfo?(diego_viper_007)
I don't see any obvious dupes of this hanging off bug 59314, so marking the dependency.
Blocks: 59314
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Product: Firefox → Toolkit
Hardware: x86 → All
Version: 8 Branch → unspecified
I can reproduce this issue on Nightly 49.0a1.

STR:
Prereq Have "Back history"
1. Go to the attachment
2 [review]. Click "Submit"
3. Press "Backspace"

Actual:
Form is submitted and the page goes back to previous page

If you do not have any "Back History" the page will stay the same with the dialog still up.

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

Still seems reproducable (thanks for the test case, RyanVM! Still paying off.) The question is, I think, whether or not backspace is expected to do the same thing as Escape for a modal, as opposed to our current behaviour which attempts to navigate the tab back.

Component: General → Notifications and Alerts
Component: Notifications and Alerts → Content Prompts

The severity field is not set for this bug.
:mtigley, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(mtigley)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: