Closed Bug 462318 Opened 16 years ago Closed 14 years ago

disabled select after ajax request

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: lampacz, Unassigned)

Details

(Whiteboard: [CLOSEME 2011-1-1])

User-Agent:       Opera/9.61 (X11; Linux i686; U; en) Presto/2.1.1
Build Identifier: FF 3.0.3

When trying send form data with ajax all selects are screwed (is not possible to change their value, after first select is not possible again to select another option) Happens only on vista (linux ok, other browsers ie, opera works ok)

Reproducible: Always

Steps to Reproduce:
file ffbug.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FF bug test</title>
<script type="text/javascript">

function getData() {
	var sData = '';
	var oForm = document.getElementById('jForm');

	for (var i = 0; i < oForm.length; i++)
		sData += (sData ? '&' : '') + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value);

	return sData; 
}

function _rpc() {
	try {
		return new XMLHttpRequest();
	} catch (error) {}
	try {
		return new ActiveXObject('Msxml2.XMLHTTP');
	} catch (error) {}
	try {
		return new ActiveXObject('Microsoft.XMLHTTP');
	} catch (error) {}
	return null;
}

function submitForm() {
	var sData = 'rSave=100&' + getData(); 
	var rpc = _rpc();
	
	rpc.onreadystatechange = function() {
		if (rpc.readyState == 4 && rpc.status == 200) {
			var x = document.createElement('div');
			x.innerHTML = rpc.responseText;
			window.document.body.appendChild(x);
		}
	};
	
 	rpc.open('POST', 'ffbug2.html', true);
	rpc.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	rpc.setRequestHeader('Content-length', sData.length);
	rpc.setRequestHeader('Connection', 'close');
	rpc.send(sData);
}

</script>
</head>
<body>
	<form action="" method="post" id="jForm">
		<select name="rF1">
			<option value="1">A</option>
			<option value="2">B</option>
			<option value="3">C</option>
		</select><br><br>
		<select name="rF2">
			<option value="1">Z</option>
			<option value="2">Y</option>
			<option value="3">X</option>
		</select><br><br>
		<input type="button" name="rSubmit" value="Submit" onclick="submitForm();">
	</form>
</body>
</html>

----------
file ffbug2.html:
<script type="text/javascript">
	alert('Response OK');
</script>

click on Submit button (you can choose other options than default) and you should get alert Response OK, then try change value of select. Is possible to drop down but selection is not acceptable and second selection of same select is not possible
Actual Results:  
unable to select another select option

Expected Results:  
able to select another select option
I confirm that happens also in latest FF 3.5.3
On windows XP and Windows 7. Didn't checked other operating systems.
Looks like this happens only if ajax loaded page has alert() in script. I had to rewrite my scripts to use custom alerts instead of default javascript alert() to be compatible with firefox. In other browsers all ok.
Reporter, are you still seeing this issue with Firefox 3.6.12 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Also, please consider using the most recent Firefox 4 beta build, your bug may be resolved there.
Whiteboard: [CLOSEME 2011-1-1]
Working in 3.6.12.

Closing
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.