blufish Posted August 1, 2008 Share Posted August 1, 2008 Heres my question, If I have a textarea, on one half of my page and on the other half I have a frame which contains whatever is written inside the textarea, how do I get it so that as soon as you change the textarea the frame changes it's contents to match the textarea. Thanks, Blufish Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 1, 2008 Share Posted August 1, 2008 No idea but I saw your making an MMOrpg, add me. andy-holland@live.co.uk lol Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 1, 2008 Share Posted August 1, 2008 It would involve AJAX - that much I know... Quote Link to comment Share on other sites More sharing options...
xenophobia Posted August 1, 2008 Share Posted August 1, 2008 So you got 2 frames right? Let's call frame1 => a.html and frame2 => b.php So let's say your textarea is in frame1 and your display will be in frame2. So in fram1, you put a form like this: <form name="postTextToFrame2" action="b.php" method="post" target="frame2"> <textarea name="myText" cols="50" rows="5"></textarea> <input type="submit" value="Post!" /> </form> So the data will be posted to the target frame. Then in frame2 (the "b.php"), you will just do something like this: <?php if(isset($_POST['myText'])) { // Print out your text!!! echo $_POST['myText']; } ?> Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 2, 2008 Share Posted August 2, 2008 For that to work you would have to post the form... Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 2, 2008 Share Posted August 2, 2008 Figured it out for you mate. <html> <head> <script type="text/javascript"> <!-- function addText(){ window.document.myForm.txtOut.value=window.document.myForm.txtIn.value; } //--> </script> </head> <body> <form method="post" name="myForm"> <center> Enter text in this box:<br /><br /> <textarea name="txtIn" cols="30" rows="5" onKeyUp="addText()"></textarea> <br /><br /><br /> And it will appear in this one:<br /><br /> <textarea name="txtOut" cols="30" rows="5"></textarea> </form> </body> </html> Definately works, I already tested it... Quote Link to comment Share on other sites More sharing options...
Andy-H Posted August 2, 2008 Share Posted August 2, 2008 And you may want to do this with the output textbox... <textarea name="txtOut" cols="30" rows="5" style="overflow:hidden" readonly="true"></textarea> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.