Permission denied XULElement.selectedIndex

Have you been seeing this exception popup in your browser console lately?

Error: [Exception... "'Permission denied to set property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup:Tongue TiedelectedIndex]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location ...

In developing my AJAX spreadsheet application, I was doing a lot of programmatic input field focus changing, and this error seemed to popup quasi-randomly. Suprisingly, the application works smooth in Internet Explorer, but fails intermittently in Firefox. Turns out this is a well known bug in Firefox’s native autocomplete functionality, and can be worked around with a simple autocomplete attribute set to “off” added to your affected fields. Problem solved.

Be aware that this will turn off the native autocomplete functionality of the input field. This shouldn’t be a big deal in most cases, but if it is, you could always replace it with a nice Protoype or JQuery style autocomplete control.


About this entry


You may also enjoy


Recent comments