Shahed's blog

Sharing my thoughts and work

  Home  |   Contact  |   Syndication    |   Login
  17 Posts | 0 Stories | 44 Comments | 10 Trackbacks

News

Archives

Post Categories

Finally I found a simple solution for the FireFox error:

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

This error occurs when focus() is called. I was reported in https://bugzilla.mozilla.org/show_bug.cgi?id=236791 but still no fix/patch from mozilla.
To avoid this error, you have to turn off autocomplete.

from javascript, you can do that in following way: obj.setAttribute('autocomplete','off');

Or, you can simply set autocomplete="off" in HTML.
posted on Monday, August 14, 2006 2:48 PM

Feedback

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 1/9/2007 2:41 PM Silicon Team
Dear Sir,

Thank you very much for your simple but great tip. We have been trying to solve this problem for the last two weeks.

Once again thanks . . .


Regards,

Silicon Team



# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 1/12/2007 6:23 PM Grant
Thanks for posting this! It saved me loads of debugging time.

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 2/2/2007 6:11 AM TheForgotton
Thanks for the fix! I'm glad I found this before tearing out too much of my hair.

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 4/26/2007 1:11 AM Unga
If you use the autocomplete="off" in HTML, FireFox may continue to issue a validation error.

A workaround strategy is to put the following snippet within your document onLoad function.

/**
* turn off the autocomplete attribute for all <input> elements :: fix to a bug with FireFox
*/
var eleObjArr=document.getElementsByTagName("input");
for(var i=0; i<eleObjArr.length; i++)
{
if( eleObjArr[i].getAttribute("autocomplete") )
{
eleObjArr[i].setAttribute('autocomplete','off');
}
}


# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 4/27/2007 7:39 AM shahed
Hi Unga,

It may not be a good idea to set autocomplete=off for all elements. Some UI may need this feature depending on implementation logic.

Firefox shows that error only for hidden/not visible elements. Could you please tell me more about the errors you said "FireFox may continue to issue a validation error".

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 7/13/2007 6:03 AM bob
Thank you so so much this saved me a lot of head scratching

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 11/30/2007 10:45 AM Rosie
Shahed,

Thanks! This saved me some time.

I found a work around if you change the format of the input element. You can use JavaScript to auto fill drop-down selections but not text boxes. You can disable the drop-down so that the selection can't be changed.

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 2/20/2008 9:13 PM selvi
Thank you very much sir for giving valuable tip

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 5/30/2008 6:42 AM Richard Robinson
Just encountered this 'permission denied to set property' error.

I have a page with an iframe that shows various graphics.
var called in parent myimage
when html page in iframe changed, page sends parent.myimage = "my.jpg"

FFox 3 Beta 5 / latest Ubuntu throws error.

Previous versions of Linux FireFox did not. FireFox 2.x on WinXP and Vista and Mac do not throw error. No error from Safari Mac or Win or from Opera Mac, Win, Linux.

Hope this gets caught in beta.

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 2/28/2009 8:36 AM hls
Like everyone else - Thanks a lot for saving tons of debugging time. I've been at this one for the last two days, pulling my hair.

Simple fix:

<script>
function setFocus(o)
{
var fi = document.getElementById(o);
if (!fv) return;
fi.setAttribute('autocomplete','off');
fi.focus();
fi.setAttribute('autocomplete','on');
}
<script>

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 4/10/2009 3:58 AM Alex
God bless u for "obj.setAttribute('autocomplete','off'); ".
I love these one-liners. :)))))
Almost tried the hundred line long fixes :)))

# re: FireFox error: [Exception... "'Permission denied to set property XULElement.selectedIndex' ... 5/30/2009 6:51 PM vikas Gupta
We can use that think also:

$('input').attr('autocomplete','off');

by which we can also prevent.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: