views:

616

answers:

1

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.

A: 

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.

Joop
@Joop: Thanks man, I will check and let you know
purnang.advant
@joop, its not working
purnang.advant
Can you post your code?
Joop