Closed Bug 120995 Opened 23 years ago Closed 23 years ago

<input onblur="this.focus()"> doesn't work, the focus is not set

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 109962

People

(Reporter: martin.honnen, Assigned: jst)

Details

Attachments

(1 file)

Sometimes with form field validation you use onblur to refocus on the element if it has not been correctly filled out for instance <input onblur="if (this.value == '') this.focus();"> This works in NN4, IE6, but with NN6.2 and Mozilla 0.9.7 it doesn't work, the focus is simply set to the next element in tab order and remains there when you tab out of the element. As my test code shows the onblur event is fired, but for unknown reasons the focus() call has no effect. The test code also contains a workaround using setTimeout to trigger the focus() call which works so it seems to be a timing problem.
*** This bug has been marked as a duplicate of 109962 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: