MozillaZine

Problem with onChange using autocomplete

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

Post Posted September 12th, 2007, 4:44 am

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 Posted September 14th, 2007, 6:02 pm

No answers about it?

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

Post Posted September 21st, 2007, 1:03 pm

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 Posted October 4th, 2007, 5:58 pm

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 Posted October 5th, 2007, 4:26 am

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 Posted October 22nd, 2007, 7:18 am

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.

DanRaisch
Moderator

User avatar
 
Posts: 106899
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the East Coast

Post Posted October 23rd, 2007, 5:01 am

Moving to Firefox Support.
Vista Home Premium 64 - FX 37.0.1 & TB 31.6.0 Win 8.1 - FX 37.0.1 and TB 31.6.0

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

Post Posted November 12th, 2007, 12:46 pm

Any replies about it?

Mordwin
 
Posts: 653
Joined: June 8th, 2005, 6:10 am

Post Posted November 15th, 2007, 3:29 am

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 Posted November 15th, 2007, 4:52 am

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 Posted November 21st, 2007, 7:42 am

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....

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 13 guests