boagworld
06-15-2005, 11:31 AM
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:
whichField.value = "";
Works great. No problem except for an error being thrown up in the firefox javascript console. Which says:
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.
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:
whichField.value = "";
Works great. No problem except for an error being thrown up in the firefox javascript console. Which says:
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.