JS Error on AutoComplete popup

RESOLVED DUPLICATE of bug 236791

Status

()

Toolkit
Form Manager
RESOLVED DUPLICATE of bug 236791
14 years ago
10 years ago

People

(Reporter: Phil Barnes, Assigned: dveditz)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040707 Firefox/0.9.2

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://URL/ :: 
scrubPin :: line 14"  data: no]
Source File: http://URL/
Line: 14

Source Code:
<script type="text/javascript">

function scrubPin(testField, maxLength, nextCell) {

	var inputValue = testField.value;
	var outputValue;
	
	if (inputValue.length >= maxLength) {	
		outputValue = stripNonNumeric(inputValue);
		testField.value = outputValue;
		
		if (outputValue.length >= maxLength) {
		
			document.entryForm[nextCell].focus();
			
		}
	}

}

function stripNonNumeric(inputValue) {
	return inputValue.replace(/[^\d]/g,'');
}
		
</script>

<form name="entryForm">
<input type="text" name="pin1" onKeyUp="scrubPin(this, 4, 'pin2');">
<input type="text" name="pin2" onKeyUp="scrubPin(this, 4, 'pin3');">
<input type="text" name="pin3" onKeyUp="scrubPin(this, 4, 'firstName');"><br>
<input type="text" name="firstName">
</form>


Reproducible: Always
Steps to Reproduce:
1. Fresh install of Mozilla(?) e.g. never used AutoComplete before
2. Run source code above
3. Enter 4 digits into first box

Actual Results:  
JS Error in console

Expected Results:  
Not generated an error

Comment 1

14 years ago
This has nothing to do with the js debugger.  Maybe "Form Handling"?
Assignee: rginda → dveditz
Component: JavaScript Debugger → Form Manager
QA Contact: caillon

Comment 2

14 years ago
I have a shorter example of similiar bug. And enter any symbol into text field,
then press Enter (don't click on submit button). then check Javascript Console.

<html>
<body>
<form action="http://www.example.com" method="get" name="frmq">
	<input type="text" name="query" value="">
	<input onClick="if (frmq.query.value.length<10 && frmq.query.value.length>0)
{alert('Too short');return false;}" type="Submit">
</form>
</body>
</html>

Comment 3

14 years ago
I get his error when I try it. LInux 2004120106

Error: [Exception... "'Permission denied to get property XULElement.accessKey'
when calling method: [nsIDOMXULLabelElement::accessKey]"  nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame ::
file:///home/jess/file.html :: onclick :: line 2"  data: no]
Source File: file:///home/jess/file.html
Line: 2

Comment 4

13 years ago
Error still occures in actual build
(Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.7) Gecko/20050414
Firefox/1.0.3)

To avoid it, you can add the attribute autocomplete="off" to the input field

Comment 5

13 years ago
Hey, this is a duplicate of bug 236791. Can someone with the necessary
privileges mark this as a dupe?

Comment 6

12 years ago

*** This bug has been marked as a duplicate of 236791 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → DUPLICATE

Updated

10 years ago
Component: Form Manager → Form Manager
Product: Core → Toolkit
QA Contact: form.manager
You need to log in before you can comment on or make changes to this bug.