Closed Bug 233510 Opened 21 years ago Closed 21 years ago

onblur focus not working

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 53579

People

(Reporter: gweber, Unassigned)

Details

User-Agent: Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 I have an input field that has an onblur function attached to it which sets the focus back to it upon meeting of some criterias. The problem is that the focus is always set to the next element. This may be critical in an on-line application for, in our case, invalid data may be sent to the server. It is as if Mozilla memorizes which element to set the focus to and does not take into account the focus setting of the underlying Javascript function. Here is the example code: <html> <script language="JavaScript"> function fncCheck(theObj) { strValidCharacters = " 0123456789abcdefghijklmnopqrstuvwxyz/-?:().,+_"; for (i = 0; i < theObj.value.length; i++) { if (strValidCharacters.indexOf(theObj.value.charAt(i)) < 0) { theObj.focus(); return false; } } return true; } </script> <form name="form"> Name: <input onblur="fncCheck(this);" name="name" type="text" value=""/> Address : <input name="address" type="text" value=""/> </form> </html> Reproducible: Always Steps to Reproduce: 1.Display the HTML page provided in the Details section. 2.Input in the "name" input field a string with a forbidden character ('A' for example) 3.Tab out Actual Results: The focus is set to the next input field. Expected Results: According to the javascript code of the onblur function, the focus should be set again to the first input field.
*** This bug has been marked as a duplicate of 53579 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.