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 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2005
    Location
    Illinois
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How do I select a text name??

    I want to select the text put into a textbox. I seem to keep getting it wrong what is my problem??

    <html>
    <head>
    <title>
    </title>

    <script type="text/javascript">


    function function1()

    {
    document.write("Welcome "+text)
    }

    </script>

    </head>

    <body>

    <form onsubmit="function1()">
    <input type="text" name="text" id="text" value="Enter Name">
    <input type="submit" value="Send">
    </form>


    </body>

    </html>


    Thanks guys
    Last edited by alvis; 10-20-2005 at 12:44 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,247
    Thanks
    203
    Thanked 2,555 Times in 2,533 Posts
    <html>
    <head>
    <title>
    </title>

    <script type="text/javascript">
    function function1(which)
    {
    document.write("Welcome "+ which.value)
    }
    </script>

    </head>

    <body>

    <form onsubmit="function1(text)">
    <input type="text" name="txt" id="text" value="Enter Name">
    <input type="submit" value="Send">
    </form>

    </body>
    </html>


  •  

    Posting Permissions

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