Closed Bug 67317 Opened 24 years ago Closed 23 years ago

Alert called from onBlur recursively brings up alert box

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

x86
Other
defect

Tracking

()

RESOLVED DUPLICATE of bug 58441
mozilla0.9.9

People

(Reporter: mlw, Assigned: joki)

References

Details

View the code below in Mozilla M18 Gecko/20010201. Click on the left hand text field. Then switch to another application, and then switch back to Mozilla. Click OK on the alert box. Another alert appears. Repeat until bored. <HTML> <BODY onload='document.testForm.text1.focus();'> <form name=testForm method=post> <input type=text name=text1 onBlur='alert(1);'> <input type=text name=text2> </form> </BODY> </HTML>
Confirmed on NT4. Could this be related to bug 66478 ?
Status: UNCONFIRMED → NEW
Ever confirmed: true
*** Bug 66478 has been marked as a duplicate of this bug. ***
Setting milestone.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Clearing Joki's list for M0.9.1 to a manageable list. Moving to next milestone.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Priority: -- → P2
QA contact updated
QA Contact: gerardok → madhur
Moving lower priority bugs out of .9.2 milestone.
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Doesn't look like this is getting fixed before the freeze tomorrow night. Pushing out a milestone. Please correct if I'm mistaken.
Target Milestone: mozilla0.9.3 → mozilla0.9.4
->0.9.5
Target Milestone: mozilla0.9.4 → mozilla0.9.5
-> 0.9.6
Target Milestone: mozilla0.9.5 → mozilla0.9.6
This bug makes field level validation in a form all but impossible. function onblur_myField(event) { ...// check validity. if (!valid) { alert("Invalid data in field"); myField.focus(); return; } .. } I have tried returning false (ala html) and cancelBubble all to no avail. The field looses focus and the alert message appears several times (and then stops). If I specify cancelBubble then an infinte alert loop ensues. }
There is a workaround for most situations I can think of: do not use alert, but write the error message into the page. In fact, I think I would prefer that to alert in many situations. For example, if you tried writing letters into the dependent bug list, we could add red, bolded message saying numbers only after the edit box when you focused somewhere else, and scroll to the red bolded message.
0.9.6 has passed, moving to 0.9.7. Load balancing 0.9.7 list shortly
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Moving bugs from 0.9.7 for triaging in 0.9.8
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
*** This bug has been marked as a duplicate of 58441 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.