0

I have the following problem:
I have .aspx page that i'm loaded into another page with <iframe>, Not i'm trying to listen to onchange event of the textbox like the following example:

<html>
<head>

</head>
<body>
<script>
function IframeLoad() {
    document.getElementById('serviceFrame').contentDocument.getElementById('txtId').value= "123";
document.getElementById('serviceFrame').contentDocument.getElementById('txtOutputId').addEventListener("change", function() {
    alert('change');
    });
 alert('IframeLoad');
};
 </script>
<iframe id="serviceFrame" src="http://localhost/MyPagey.aspx" width="100"     height="100"  align="right" frameborder="0" onload="IframeLoad()"/>
</body>
</html>

I have inside my .aspx page two TextBox elements.
What is the problem? Why OnChange event isn't called?

CSharpBeginner
  • 521
  • 2
  • 6
  • 20

0 Answers0