Results 1 to 2 of 2

Thread: How do I?

  1. #1
    Join Date
    Dec 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do I?

    I've got two form elements, the first is a select box with some codes say "abc", when you select ABC, it loads the product name into a textbox. How do I do it?

  2. #2
    Join Date
    Dec 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <html>
    
    <head>
    
    <title>My home page</title>
    
    <script type="text/javascript">
    function printtotextbox(what) {
    box = document.yourform.textbox;
    box.value=box.value + " " + what;
    }
    </script>
    </head>
    
    <body>
    <form name="yourform">
    <input type="checkbox" name="Alpha" value="abc" onclick="printtotextbox('abc')">abc<br>
    <input type="checkbox" name="Alpha" value="def" onclick="printtotextbox('def')">def<br>
    <input type="checkbox" name="Alpha" value="ghi" onclick="printtotextbox('ghi')">ghi<br>
    
    <input type="text" name="textbox" value="Selected products:">
    </body>
    </html>
    That should work.
    Last edited by Iiro; 12-22-2005 at 10:41 AM.

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
  •