X
Нажмите здесь, чтобы перейти на мобильную версию сайта.

Форум поддержки

The change event is not firing when bound to a input text field in FF 15

Размещено

$("#dealer-warranty-parts-percent").bind('change', function(){ data.partsPercent = $(this).val(); AMMS.dealerWarrantyModified = 1; });

This code will not fire in the latest (FF 15) version of FF but does fire in the previous version. I am now having to switch to blur event.

$("#dealer-warranty-parts-percent").bind('change', function(){ data.partsPercent = $(this).val(); AMMS.dealerWarrantyModified = 1; }); This code will not fire in the latest (FF 15) version of FF but does fire in the previous version. I am now having to switch to blur event.

Выбранное решение

Never mind after further digging in the code there appears to be an issue with binding the keyup event that was deeper in the code that appears to be the ultimate culprit.

Прочитайте этот ответ в контексте 0

Дополнительные сведения о системе

Это случилось

Каждый раз при открытии Firefox

Это началось когда...

After updateing to latest version of FF (15)

Установленные плагины

  • Shockwave Flash 11.4 r402
  • Adobe PDF Plug-In For Firefox and Netscape 10.1.4
  • Google Update
  • Winamp Application Detector
  • 4.1.10329.0
  • Next Generation Java Plug-in 1.6.0_31 for Mozilla browsers
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Intel WebAPI Updater - Installs and updates Intel WebAPIs
  • Inte IPT Web API
  • VMware Remote Console and Client Integration Plug-in
  • wpidetector
  • NPWLPG
  • Fortinet SSL VPN FortiControl Firefox Plugin
  • Fortinet SSL VPN CacheClean Firefox Plugin
  • The plug-in allows you to open and edit files using Microsoft Office applications
  • Office Authorization plug-in for NPAPI browsers

Приложение

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0

Дополнительная информация

This code no longer gets fired with the latest version
$("#dealer-warranty-parts-percent").bind('change', function(){
data.partsPercent = $(this).val();
AMMS.dealerWarrantyModified = 1;
});

jscher2000
  • Top 10 Contributor
8837 решений 72222 ответов
Размещено

I don't see that mentioned in this article as an intentional change: https://developer.mozilla.org/en-US/docs/Firefox_15_for_developers

When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.

1. Bypass Firefox's Cache

Use Ctrl+Shift+r to reload the page fresh from the server.

If you are using a remotely hosted copy of jQuery (etc.) you might also clear Firefox's cache completely:

orange Firefox button or Tools menu > Options > Advanced

On the Network mini-tab > Cached Web Content : "Clear Now"

2. If needed, remove your site's cookies in this dialog

While viewing a page on the site, right-click and choose View Page Info > Security > "View Cookies"

Then try reloading the page. Does that make any difference?

I don't see that mentioned in this article as an intentional change: https://developer.mozilla.org/en-US/docs/Firefox_15_for_developers When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site. 1. Bypass Firefox's Cache Use Ctrl+Shift+r to reload the page fresh from the server. If you are using a remotely hosted copy of jQuery (etc.) you might also clear Firefox's cache completely: orange Firefox button ''or'' Tools menu > Options > Advanced On the Network mini-tab > Cached Web Content : "Clear Now" 2. If needed, remove your site's cookies in this dialog While viewing a page on the site, right-click and choose View Page Info > Security > "View Cookies" Then try reloading the page. Does that make any difference?
cor-el
  • Top 10 Contributor
  • Moderator
17680 решений 159921 ответов
Размещено

Any errors in the Web Developer > Error Console (Ctrl+Shift+J)?

Any errors in the Web Developer > Error Console (Ctrl+Shift+J)?
carmijac 0 решений 3 ответов
Размещено

The below code does not work.

<input id='test' onchange='alert("test")' />

Any ideas?

The below code does not work. <input id='test' onchange='alert("test")' /> Any ideas?
Размещено

Задавший вопрос

I tried clearing the cache as recommended as well as the cookies and I am still getting the same behavior. I am not seeing any error is the Error console relating to to this.

The above code is functioning correctly in Chrome.

I tried clearing the cache as recommended as well as the cookies and I am still getting the same behavior. I am not seeing any error is the Error console relating to to this. The above code is functioning correctly in Chrome.
jscher2000
  • Top 10 Contributor
8837 решений 72222 ответов
Размещено

Does the event fire when you tab out of the control? That is what is supposed to happen per W3C DOM Level 2:

change
The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element.

Does the event fire when you tab out of the control? That is what is supposed to happen per [http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-htmlevents W3C DOM Level 2]: '''change'''<br> The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element.
cor-el
  • Top 10 Contributor
  • Moderator
17680 решений 159921 ответов
Размещено

Do you have a test page with that code?


carmijac

Works for me on Linux.

data:text/html;charset=utf-8,<input id='test' onchange='alert("test")' />
Do you have a test page with that code? ---- carmijac Works for me on Linux. <pre><nowiki>data:text/html;charset=utf-8,<input id='test' onchange='alert("test")' /></nowiki></pre>
carmijac 0 решений 3 ответов
Размещено

Changing the event from onchange to onblur worked for me

Changing the event from onchange to onblur worked for me
Размещено

Задавший вопрос

"Changing the event from onchange to onblur worked for me "

That is the fix that I have placed into the code. I am trying to determine exactly what broke the code between version 14 and version 15.

"Changing the event from onchange to onblur worked for me " That is the fix that I have placed into the code. I am trying to determine exactly what broke the code between version 14 and version 15.

Изменено rlm1966

carmijac 0 решений 3 ответов
Размещено

Anyone know what changed from 14 to 15?

Anyone know what changed from 14 to 15?
Размещено

Выбранное решение

Never mind after further digging in the code there appears to be an issue with binding the keyup event that was deeper in the code that appears to be the ultimate culprit.

Never mind after further digging in the code there appears to be an issue with binding the keyup event that was deeper in the code that appears to be the ultimate culprit.
rchicangana 0 решений 5 ответов
Размещено

I have the same problem, does not fire the event and error consoloa shows no error, the strangest thing is that if no events are fired onChange in version 14.01 and earlier worked without problem

I have the same problem, does not fire the event and error consoloa shows no error, the strangest thing is that if no events are fired onChange in version 14.01 and earlier worked without problem
rchicangana 0 решений 5 ответов
Размещено

in my forms use iniTodo function (http://javascript.espaciolatino.com/scripts/editinputnume.htm) to format a number while typing, this seems to affect the operation of onChange, seems a bug in Firefox since the previous versions had no problem with that, and in the other browsers it works without problem

in my forms use iniTodo function (http://javascript.espaciolatino.com/scripts/editinputnume.htm) to format a number while typing, this seems to affect the operation of onChange, seems a bug in Firefox since the previous versions had no problem with that, and in the other browsers it works without problem
jscher2000
  • Top 10 Contributor
8837 решений 72222 ответов
Размещено

Hi rchicangana, your function binds to onkeyup. Does it work with onkeyup? Is there a different function that you are binding to onchange?

Hi rchicangana, your function binds to onkeyup. Does it work with onkeyup? Is there a different function that you are binding to onchange?
rchicangana 0 решений 5 ответов
Размещено

if it seems onkeyup problems, I have another function to mask the dates and also when typing text on the field is no longer running the onchange, report it in bugzilla

if it seems onkeyup problems, I have another function to mask the dates and also when typing text on the field is no longer running the onchange, report it in bugzilla
Mygind 0 решений 6 ответов
Размещено

Using FireFox 15.0.1:

In the following code the "onChange" event does not fire with the tab key, but will fire when the mouse click is used to advance the cursor.

 td.innerHTML = '<input '+
     'type="text" '+
     'id  ="JOBID_'+cNextLine+'" '+
     'name="JOBID_'+cNextLine+'" '+
     'class="InputText" '+
     'size ="7" '+
     'maxlength="6" '+
     'onfocus="turnOnSearch(this);" '+
     'onKeyPress="this.value = this.value.toUpperCase(); return loadPhaseCoder(event, this);" '+
     'onchange ="if (cSetLoc(this)) {isNotEmpty(this); getPrjct(this); DataChanged();}" '+
     'onblur = "if (cSetLoc(this)) {updateJobId(this); turnOffSearch();}" '+
     '/> ';

Likewise the same is true for this code using the "addEventListner"

 g.getClient = document.getElementById('ID');
 if (g.getClient.addEventListener)
 {
  g.getClient.addEventListener("change",g.requestClient,false);
 }

This code has been running since 2009 with no problems right up to version 14.1

It will be good to know when FireFox fixes the problem. It should be noted the code still works in Google's Chrome.

Using FireFox 15.0.1: In the following code the "onChange" event does not fire with the tab key, but will fire when the mouse click is used to advance the cursor. <pre><nowiki> td.innerHTML = '<input '+ 'type="text" '+ 'id ="JOBID_'+cNextLine+'" '+ 'name="JOBID_'+cNextLine+'" '+ 'class="InputText" '+ 'size ="7" '+ 'maxlength="6" '+ 'onfocus="turnOnSearch(this);" '+ 'onKeyPress="this.value = this.value.toUpperCase(); return loadPhaseCoder(event, this);" '+ 'onchange ="if (cSetLoc(this)) {isNotEmpty(this); getPrjct(this); DataChanged();}" '+ 'onblur = "if (cSetLoc(this)) {updateJobId(this); turnOffSearch();}" '+ '/> '; </nowiki></pre> Likewise the same is true for this code using the "addEventListner" <pre><nowiki> g.getClient = document.getElementById('ID'); if (g.getClient.addEventListener) { g.getClient.addEventListener("change",g.requestClient,false); } </nowiki></pre> This code has been running since 2009 with no problems right up to version 14.1 It will be good to know when FireFox fixes the problem. It should be noted the code still works in Google's Chrome.

Изменено cor-el

jscher2000
  • Top 10 Contributor
8837 решений 72222 ответов
Размещено

Hi Mygind, are there any new errors in Firefox's Error Console (Ctrl+Shift+j) that you did not get in Firefox 13 or earlier? Also, can you tell whether Firefox is firing the events in a different order than before? I would think that for a click away you would get blur then change, and on tab you would get keypress then blur then change. However, I haven't tested/compared.

Hi Mygind, are there any new errors in Firefox's Error Console (Ctrl+Shift+j) that you did not get in Firefox 13 or earlier? Also, can you tell whether Firefox is firing the events in a different order than before? I would think that for a click away you would get blur then change, and on tab you would get keypress then blur then change. However, I haven't tested/compared.
rrd108 0 решений 3 ответов
Размещено

I have the same problem.
Reproduce:
1. Load a html page with a text input.
2. Open Firefox Firebug - html tab - select the input box - right click - log events
3. Go to the console tab
4. Click on the input, give same value and press tab or click out
Firebug will show all the events except the "change"

Actually I tried the same with this page, with the search input and it worked. I do not have time to dig into it more. Maybe because this page is HTML5 and I had the problem with a XHTML 4 Transitional page.


[corrected formatting and changed Firefox -> Firebug -c]

I have the same problem.<br /> Reproduce: <br /> 1. Load a html page with a text input.<br /> 2. Open <strike>Firefox</strike> Firebug - html tab - select the input box - right click - log events<br /> 3. Go to the console tab<br /> 4. Click on the input, give same value and press tab or click out<br /> Firebug will show all the events except the "change"<br /> <br /> Actually I tried the same with this page, with the search input and it worked. I do not have time to dig into it more. Maybe because this page is HTML5 and I had the problem with a XHTML 4 Transitional page. ''[corrected formatting and changed Firefox -> Firebug -c]''

Изменено cor-el

jscher2000
  • Top 10 Contributor
8837 решений 72222 ответов
Размещено

Полезный ответ

Hi rrd108, I think you meant Firebug. When I perform that test using the search box at the top of the page, I get change fired before blur when I tab over to the submit button.

By the way, thank you for pointing out this method of investigating the sequence of events, it's really handy.

Hi rrd108, I think you meant Firebug. When I perform that test using the search box at the top of the page, I get change fired before blur when I tab over to the submit button. ''By the way, thank you for pointing out this method of investigating the sequence of events, it's really handy.''

Изменено jscher2000

rrd108 0 решений 3 ответов
Размещено

Yes, sorry I meant Firebug. And yes it gives change event on this page, but does not give on my web app. That is why I thought it is because of the doctype, but I did not have time to investigate more.

Yes, sorry I meant Firebug. And yes it gives change event on this page, but does not give on my web app. That is why I thought it is because of the doctype, but I did not have time to investigate more.
rrd108 0 решений 3 ответов
Размещено

I just upgraded to Firefox 15.0.1 and still change event do not fires.

I just upgraded to Firefox 15.0.1 and still change event do not fires.