I opened an iFrame in my page and onClick event try to send a value to the textbox of the iframe
This is my javascript code
<script type="text/javascript">
function TextToFrame()
{
var frame = frames['frame1'];
frame.document.getElementById("u").value = "wallace";
}
</script>
IFrame loads the page but when I click the Button , it doesn’t send any value.
It refreshes the main page and iFrame
<asp:Button ID="Button1" runat="server" OnClientClick="TextToFrame();" Text="Send Value" />
<IFRAME id="frame1" name="frame1" src="http://tweakers.net/my.tnet/login?location=http%3A%2F%2Ftweakers.net%2F" width=500px height=500px runat="server">
What am I doing wrong?
any help appreciated
I don’t think you can modify the HTML in an iframe from a different domain. You might be able to change the iframe source to something like:
but the site should give you an option like that.