Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple html form question

    hello,
    i am a complete newcomer to html with a simple question. could someone tell me how to do this - based on the following code....

    <p>&nbsp;</p>
    <form name="form1" method="post" action=http://www.mysite.com/*****/wfb.php>
    <input type="text" name="textfield">
    </form>
    <p>&nbsp;</p>

    how do i have the outcome of this text input form be inserted into the gap where the asterisks are? basically what i am trying to do is when you type in the text box and hit enter, you should be redirected to a URL with what you just typed included in its makeup.

    many thanks for any help!
    sdptwd

  • #2
    Regular Coder Coastal Web's Avatar
    Join Date
    Oct 2004
    Posts
    225
    Thanks
    12
    Thanked 3 Times in 3 Posts
    Many ways you could accomplish this (all of which you'd need to jump from HTML to another language...)

    lets go with a simple javascript example that would work when hosted nearly anywhere. here's how it'd look:
    (this has been tested, and works)
    -------------------------------------------------

    <html>
    <head>
    <script language="JavaScript">
    <!---

    function getMyPage(){
    myArea = document.myForm.textfield.value;
    location.replace("http://www.mysite.com/"+myArea+"/wfb.php");
    }

    //--->
    </script>
    </head>

    <body>
    <form name="myForm" action="javascript:getMyPage();">
    <input type="text" name="textfield" size="15">
    <input type="submit" value="Go!" name="submit">
    </form>

    </body>
    </html>


    Post back any questions or problems you have.
    Samantha Gram

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hello samantha

    thanks a million for the quick reply and solution. im pleased to say it works like a charm and the system is up and running now!

    thanks again
    sdptwd

  • #4
    Regular Coder Coastal Web's Avatar
    Join Date
    Oct 2004
    Posts
    225
    Thanks
    12
    Thanked 3 Times in 3 Posts
    dont mention it

    Samantha Gram


  •  

    Posting Permissions

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