dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: code to place the content of a window in textarea

  1. #1
    Join Date
    Jan 2010
    Posts
    73

    code to place the content of a window in textarea

    ________________________FIRST.HTML_________________________
    <html>
    <head>
    <script language="javascript">
    var myfunc;
    function grace() {
    myfunc=window.open("lifted.html", "light");
    }
    </script>
    </head>
    <body>
    <form onSubmit="light.html">
    YOUR EMAIL HERE:<input type="text" name="text23" value=""><br>
    math:<input type="text" name="texter200" value=""><br>
    eng:<input type="text" name="textron2300" value=""><br>
    <input type="button" name="button12" value="SEND-FOWARD" onClick="grace()">
    </form>
    </body>
    </html>________________________________________________________________


    _____________________LIFTED.HTML__________________________

    <html>
    <head>
    </head>
    <body onLoad="getIt()">
    <script language="javascript">


    function getIt() {
    var fName=self.opener.document.forms[0].text23.value;
    document.myform.mytextbox.value=document.write("<font color=red>" +fName +"</font>");
    var strmath=self.opener.document.forms[0].texter200.value;
    var streng=self.opener.document.forms[0].textron2300.value;

    nMath=parseInt(strmath);
    nEng=parseInt(streng);
    var nresult= nMath + nEng;

    var mercy="<HTML><BODY><CENTER><TABLE CELLPADDING=2, CELLSPACING=3>"
    mercy +="<TR><TD ALIGN=RIGHT><B>MATHEMATICS <B></TD>" +"<TD><I><font color=blue>" +nMath +"</font></I></TD></TR>";
    mercy +="<TR><TD ALIGN=RIGHT><B>RESULT <B></TD>" +"<TD><I><font color=blue>" +nresult +"</font></I></TD></TR>";
    mercy +="</TABLE></CENTER></BODY></HTML><BR></BR>";

    document.myform.textareapass.value= document.write(mercy);

    }
    </script>
    <form name="myform">
    <input type="text" name="mytextbox" value="" readonly><br>
    <textarea name="textareapass" readonly rows=10 cols=30></textarea><br>
    <input type="button" name="submit" value="SUBMIT">
    </form>
    </body>
    </html>

    hi
    It is very wonderful meeting you. Thanks for your concern in helping me to fix this problem. Without been in a haste, please kindly intellectually follow my explanation. It’s simply thus:
    From the code snippet above I have two (2) windows:
    (1) first.html,
    ( 2) lifted.html.
    When the ‘SEND-FORWARD button’ of the ‘first.html’ is clicked it brings the lifted.html.
    On the line 21st of the ‘lifted.html’ I passed the variable to the textarea as this:
    document.myform.textareapass.value= document.write(mercy);
    and the
    document.myform.mytextbox.value=document.write("<font color=red>" +fName +"</font>");


    It worked but displays the content in the ‘lifted.html window’. That is not what I want; I want it to display the content in the textbox and the textarea to send it to an email (since emails are only send-able in a textarea) not in the ‘lifted.html window’. How do I do this? Please help me out!

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    I want it to display the content in the textbox
    Only text can be placed in the form element, not html.
    and the textarea to send it to an email (since emails are only send-able in a textarea) not in the ‘lifted.html window’.
    Use serverside scripting if you want to send a html email.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles