3 Replies Latest reply on Oct 19, 2006 4:40 AM by Newsgroup_User

    Javascript question

    Level 7
      I have been searching for the last 2 day for a javascript function that
      someone told me about. I am trying to populate a select field, set to list,
      with uploaded values. What I need to do is when the user clicks on the item
      in the list, the value is inserted into a textarea. This is where the
      javascript comes in, I guess.

      Does anyone know what that would be called so I can look for it on
      Blingo/Google?

      Thanks


        • 1. Re: Javascript question
          Dan Bracuk Level 5
          for your select, add an attibute like this:

          onclick="otherfield.value=this.value;"

          The syntax might not be correct but the general idea is.
          • 2. Re: Javascript question
            Level 7
            Try this:

            <script type="text/javascript">
            <!--
            function fillText() {
            var Current =
            document.myForm.mySelect.selectedIndex;
            document.myForm.myText.value =
            document.myForm.mySelect.options[Current].value;
            }
            //-->
            </script>

            <form id="myForm" name="myForm">
            <select id="mySelect" name="mySelect" onchange="fillText()">
            <option value="">--none--</option>
            <option value="2.50">alpha</option>
            <option value="1.95">beta</option>
            <option value="3.00">gamma</option>
            </select>
            <input id="myText" name="myText" type="text">
            </form>


            --
            Ken Ford
            Adobe Community Expert
            Fordwebs, LLC
            http://www.fordwebs.com


            "Wally Kolcz" <wkolcz@softproofs.com> wrote in message
            news:eh2fji$1ot$1@forums.macromedia.com...
            >I have been searching for the last 2 day for a javascript function that
            >someone told me about. I am trying to populate a select field, set to list,
            >with uploaded values. What I need to do is when the user clicks on the item
            >in the list, the value is inserted into a textarea. This is where the
            >javascript comes in, I guess.
            >
            > Does anyone know what that would be called so I can look for it on
            > Blingo/Google?
            >
            > Thanks
            >


            • 3. Re: Javascript question
              Level 7
              The script works great in autofilling the text area with the value of the
              drop down.
              What I need to do is to be able to insert items from the list into a text
              area with a double click.
              How can I modify that to target my textarea ('html') and only add the item
              to the textarea?

              Thanks!