Closed
Bug 478806
Opened 16 years ago
Closed 16 years ago
confirm function of javascript enter in a loop if after this function is modified a readOnly propriety
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 302787
People
(Reporter: giacomololo, Unassigned)
Details
(Whiteboard: DUPEME?)
User-Agent: Opera/9.63 (X11; Linux x86_64; U; en) Presto/2.1.1
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; it; rv:1.9.0.6) Gecko/2009021614 Gentoo Firefox/3.0.6
If I open this html file:
<html>
<head>
<title></title>
<meta content="">
<script type="text/javascript">
<!--
function readonlyFun(){
var read = confirm('Se vuoi modificare i dati stampo premi \"Ok\" altrimenti premi \"Cancel\"?')
document.getElementById("test").readOnly=read;
}
// -->
</script>
<style></style>
</head>
<body>
<input size="5" value="" id="test" onFocus="readonlyFun()">
</body>
</html>
and then I click on input box, the javascript function readonlyFun() enter in a loop.
Reproducible: Always
Steps to Reproduce:
1.Open the html file that I posted
2.Click on the input box
3.And then click on cancel or ok button of the confirm window.
Actual Results:
If I click on cancel or ok button, the confirm windows appear again
Expected Results:
If I click on cancel or ok button, the confirm windows must appear again only if I click again on the input box.
I have a clean installation of firefox 3.0.6, without plugin and extension. In the same version of firefox on windows XP all work correctly. On the same version of firefox on another linux box there is the same issue.
Comment 1•16 years ago
|
||
Modal-dialog badgering is covered by bug 432687 (or more specifically bug 61098). If you're worried about the modal loop this is a duplicate.
If you're reporting the platform inconsistency in how focus works then we could steer this bug in that direction. You seem to be saying that on Windows focus does not return to the text box (or at least the onFocus event isn't fired) while on Linux it is.
Group: core-security
Whiteboard: DUPEME?
Reporter | ||
Comment 2•16 years ago
|
||
I'm reporting a problem on focus, it seems that when the readOnly property of a input box (<input onFocus="functionXXX()">) is modified by a javascript (by functionXX()), the input box take the focus another time and recall the javasccript functionXXX() that change the readOnly property, so javascript enter in a loop.
An example is my script sent some hours ago.
Reporter | ||
Comment 3•16 years ago
|
||
Sorry, the correct script is this:
<html>
<head>
<title></title>
<meta content="">
<script type="text/javascript">
<!--
function readonlyFun(){
var read = confirm('Press Ok or Cancel!');
document.getElementById("test").readOnly=read;
}
// -->
</script>
<style></style>
</head>
<body>
<input size="5" value="" id="test" onFocus="readonlyFun()">
</body>
</html>
A ; was missing!!!
Create the html file and open it. It should appear a confirm windows every time you click on the input box, and when you click on "cancel" or "ok" button, it must disappear. On firefox 3.0.6 on linux this doesn't happend, when you click on "cancel" or "ok", the confirm windows appear again immediatly!!!
There isn't that much of a difference between confirm() and alert(), so...
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•