Problem with onChange using autocomplete

User Help for Mozilla Firefox
Post Reply
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Problem with onChange using autocomplete

Post by charleswc »

Hello,

I'm currently using firefox 2.0.0.6 and when I use the autocomplete feature I don't have the onChange event fired. While I was using the versions before firefox 2 the thing that I mentioned before worked as I expected.

Does anybody have an explanation for this change?

Here I have a html sample that generates this issue.

<html>
<head>
<title>Mozilla Firefox Problem</title>
<script language="javascript">
function fOnChange()
{
alert('OnChange Fired');
}
</script>
</head>
<body>
<form name="frm">
<table>
<tr>
<td><input type="text" name="textBox" onChange="javascript:fOnChange()"></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</form>
</body>
</html>

Steps to generate the "problem"

1) Type a text in the text box and then press Submit.
2) Type another word and do the same as before.
3) Double click the text box (you'll see a list with the words typed before), choose one of items, press the Submit button and then you'll realize that the message 'OnChange Fired' will not be displayed.

Thanks in advance.
Charles
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

No answers about it?
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

I really need to know if this is a bug or not.

Plz.

Thanks in advance
mmpost99
Posts: 2
Joined: October 4th, 2007, 5:19 pm

Post by mmpost99 »

I'm using firefox 2.0.0.7 and I'm running into the same problem.
Mordwin
Posts: 653
Joined: June 8th, 2005, 6:10 am

Post by Mordwin »

The onChange event should apparently fire when focus leaves a form element and it's contents have changed between it receiving focus and losing it.

The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA.


As this is not happening in this case and that would seem to be a pretty strong indicator that this is a bug.
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

Thanks for your reply Mordwin.

What do we have to do to Firefox solve this problem because I also think this is a bug.

Thanks in advance.
User avatar
DanRaisch
Moderator
Posts: 127231
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post by DanRaisch »

Moving to Firefox Support.
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

Any replies about it?
Mordwin
Posts: 653
Joined: June 8th, 2005, 6:10 am

Post by Mordwin »

Looks like this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=87943 - which is over 6 years(!) old...

Meantime, you can do this:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Mozilla Firefox Problem</title>
<script type="text/javascript">
function fOnChange()
{
  alert('OnChange Fired');
}

var val_textBox;

function fOnFocus()
{
  val_textBox = document.getElementById('textBox').value;
}

function fOnBlur()
{
  if (val_textBox != document.getElementById('textBox').value) {
    fOnChange();
  }
}
</script>
</head>
<body>
<form name="frm">
<table>
<tr>
<td><input type="text" id="textBox" name="textBox" onFocus="fOnFocus()" onBlur="fOnBlur()"></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</form>
</body>
</html>
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

Thanks for your reply Mordwin, you really helped me with your suggestion!

Do you know what do we have to do to get this bug fixed by the Firefox team?

Cheers
charleswc
Posts: 6
Joined: September 12th, 2007, 4:20 am

Post by charleswc »

That's me again...

I remembered one important thing....as I mentioned before (Im currently using firefox 2.0.0.6 and when I use the autocomplete feature I don't have the onChange event fired. While I was using the versions before firefox 2 the thing that I mentioned before worked as I expected.) this problem started to happen in firefox 2.0.0.0...

Waiting for more other replies....
Post Reply