PDA

View Full Version : JavaScript And Frames



Gaybo
Nov 14th, 2009, 09:33 PM
What's Up?

OK, So I've been trying to add text to a <textarea> and text field tag inside of a frame via JavaScript, I did find a tutorial and using off-line html's it worked, But when I try to use a online frame, It doesn't work.

OK, So one html opens two frames which are.

Left.html

<HTML>
<HEAD>
<TITLE>JavaScript Example 13</TITLE>
</HEAD>
<BODY>
<INPUT type="button" value="Button" onClick="">
</FORM>
</BODY>
</HTML>

right.html

<form action="posting.php" method="post" name="post" onsubmit="return checkForm(this)">
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<input class="post" type="text" value="" tabindex="2" style="width: 450px;" maxlength="60" size="45" name="subject"/>
<textarea onkeyup="storeCaret(this);" onclick="storeCaret(this);" onselect="storeCaret(this);" class="post" tabindex="3" style="width: 450px;" cols="35" rows="15" name="message"/></textarea>
<input type="submit" value="Submit" class="mainoption" name="post" tabindex="6" accesskey="s"/>

Anyone Know What To Do?

Thanks Bye.

Old Pedant
Nov 15th, 2009, 12:13 AM
From the fact you say your code worked offline but not online, I'd guess that the pages for the two frames are from different domains. And then you aren't allowed to do this. You can only affect another frame (or window) if the page it is displaying came from the same domain as the page making the effort.

If that's not the problem, then how about showing us the code that *did* work???