JavaScript - checking of form inputs

VERIFIED DUPLICATE of bug 53579

Status

()

Core
JavaScript Engine
VERIFIED DUPLICATE of bug 53579
16 years ago
16 years ago

People

(Reporter: Juxi Leitner, Assigned: rogerl (gone))

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
When trying to jump back to the input field after checking the data put into,
the following JavaScript function is executed without errors, but still the
button (or the next input field) is selected, not the one represented by field:

function checkKlasse(field){
	if(field.value != 'J' && field.value != 'K') {
		field.focus();
		field.select();
	}					
}
Reporter: could you attach a complete testcase ?
And please tell us your build-ID.
(Reporter)

Comment 2

16 years ago
There's a short example:
http://dir.juxi.dyndns.org/projects/JStest.html
when entered a non-number value in one of the fields and then set the focus in
another one (by just clicking in another one or pressing TAB) the onblur
function should be called! The error is printed, but the focus and the selection
NOT set! If you try it with another browser (e.g. IE) it is!
My build is: 2002072104
Confirmed on WinXP trunk build 2002072308.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Duplicate of "calling this.blur() in onfocus handler or this.focus() in an
onblur handler do not work"
*** This bug has been marked as a duplicate of 53579 ***

*** This bug has been marked as a duplicate of 53579 ***
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE

Comment 6

16 years ago
Verified Duplicate. 

Juxi: thank you for this report. You have been cc'ed on the
duplicate bug so you can follow its progress -
Status: RESOLVED → VERIFIED
(Reporter)

Comment 7

16 years ago
thx!
You need to log in before you can comment on or make changes to this bug.