Results 1 to 5 of 5

Thread: help.

  1. #1
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help.

    How do I send like one form entry to a text area in a new page??? does it need java script??? or is there a code???

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This was discussed a while ago. A referral was made to a script designed to parse GET variables from URIs, but I can't seem to find it again; perhaps John or Mike knows where it is?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you Google:

    "site:http://www.dynamicdrive.com/forums/archive/ var1 jscheuer1"

    without the quotes, you will find tons of examples. A basic approach could be, to have on the sending page:
    Code:
    <input id="sendInfo" type="text" value="default"><br>
    <a href="somepage.htm" onclick="location.href=this.href+'?var1='+escape(document.getElementById('sendInfo').value);return false;">Link</a>
    and your receiving page could look like this:
    Code:
    <html>
    <head>
    <title>Somepage</title>
    <script type="text/javascript">
    function populate() {
    var str = unescape(location.href);
    thePos = str.indexOf("=") + 1;
    document.getElementById('recInfo').value=str.substr(thePos);
    }
    
    window.onload=populate;
    </script>
    </head>
    <body>
    <input id="recInfo" type="text">
    </body>
    </html>
    Last edited by jscheuer1; 07-28-2005 at 12:04 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There we are.
    You can use a form too:
    HTML Code:
    <form action="somepage.htm" method="get">
    <input type="text" id="sendInfo"/>
    <input type="submit"/>
    </form>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That would be:
    Code:
    <form action="somepage.htm" method="get">
    <input type="text" name="sendInfo"/>
    <input type="submit"/>
    </form>
    Using id instead of name, as Twey did in his example will not send anything. Probably just an honest slip, I'm sure Twey knows better. I'm so unfamiliar with forms that I didn't even bother trying to figure it out. Once I saw Twey's example I thought, "Right, that's what I was trying to think of." So, I am grateful for the effort.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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