onchange event not fire in google chrome

I have a web application build on asp.net, the Textbox onchange event not working in chrome? On page load i wrote this code,

textbox1.Attributes.Add("onchange", "SetEditDataFlag();");

SetEditDataFlag() -- it is a javascript function. When I browse the application in chrome then this function is not called when i changed some value on the textbox.Its working properly in IE.

Thanks in advance.Please help me.

Answers


Thanx a lot..! I am facing another problem here I have button on my .aspx page. The button click event is fire from java script. But i got a prblem in chrome the click event is not fired. var btnSave = document.getElementById('ctl00_TabContainer1_TabEvaluation_cpEvaluation_btnSave'); if (docVal != "") { btnSave.click(); alert("The changes are saved sucessfully!!"); } }

The code you are posting isn't that much, but I will do whatever I can to push you in the right direction.

Most browses don't support that you can fire the event of a button, or other control, like "click". Better way:

var btnSave = document.getElementById('ctl00_TabContainer1_TabEvaluation_cpEvaluation_btnSave');
btnSave.onclick = function() { 
    if(!typeof(docVal) == "undefined" && docVal != null && docVal != "") { 
         alert("The changes are saved successfully!!"); 
    }
};

Hope this works for you.


Need Your Help

Submit form on Enter key with javascript

javascript forms key submit enter

I'm not sure what I am doing wrong here. I want the enter key to work as well as clicking the button.

applying paddingRight to flex grid column not to grid header

flex flex-mx

Whenever I add paddingRight to a column in the flex grid, it adds the padding to the header as well.