Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-15-2005, 10:31 AM   PM User | #1
boagworld
New to the CF scene

 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
boagworld is an unknown quantity at this point
Permission denied to get property XULElement.selectedIndex

Hi all,
first of all let me say I am a newbie both to this forum and to DOM scripting so please don't flame me if I am making an idiot of myself. A polite go away will do

I am trying to achieve a very simple thing. Basically when a user clicks in a form field I want it to clear the content. No problem I hear you cry.

First I detect which field they are clicking in and set that field as a var whichField. Then I do this:

Code:
whichField.value = "";
Works great. No problem except for an error being thrown up in the firefox javascript console. Which says:

Code:
Error: [Exception... "'Permission denied to get property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup::selectedIndex]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame :: http://www.boagworld.com/boagworld.js :: clearField :: line 34"  data: no]
Source File: http://www.boagworld.com/boagworld.js
Line: 34
Now from looking around the web the only way this can be fixed appears to be by adding autocomplete="off" to the INPUT tag but this invalidates my code.

What should I do? Should I just ignore the error or does somebody have a nice fix.

To see all the javascipt involved go to:

www.boagworld.com/boagworld.js

Any help would be much appreciated.
boagworld is offline   Reply With Quote
Old 02-09-2006, 02:14 AM   PM User | #2
rickeyFitts
New to the CF scene

 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rickeyFitts is an unknown quantity at this point
Simple solution

I struggled with this problem for half a day ....and finally found a simple fix.

Error: [Exception... "'Permission denied to get property XULElement..."

This is apparently a bug in FireFox's AutoComplete code. I found a reference to this in Bugzilla, and was able to avoid it like this:

<input type="text" autocomplete="off" name="fname"> etc.

The error message went away and all is well. It did not seem to have any problems in IE before or after adding the autocomplete parameter. Although technically autocomplete is not a "valid" parameter in XHTML 1.0 transitional, or probably most other versions of HTML/XHTML, it's the only way I could keep the FireFox exception from being thrown.

'hope this helps.

Last edited by rickeyFitts; 02-09-2006 at 02:18 AM..
rickeyFitts is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:56 AM.


Advertisement
Log in to turn off these ads.