Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding a selected value from a listbox to a form.

Posted on 2002-03-08
4
Medium Priority
?
360 Views
Last Modified: 2013-12-23
How do I add a value that I click on in a listbox (created in HTML) to a textbox in a form (<FORM></FORM>).

The listbox is not in the <FORM></FORM> tags.

How?????

Thanks

Hannes

0
Comment
Question by:hannes1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Expert Comment

by:vindevogel
ID: 6850566
    <html>
          <head>
               <script language=vbscript>
                    sub SetTextbox
                         window.document.forms(0).txtBox.value = select1.options( select1.selectedIndex ).text
                    end sub
               </script>
          </head>
         
          <body>
               <form>
                    <input type=text id=txtBox>
               </form>
               
               <SELECT size=2 id=select1 name=select1 onclick="SetTextBox">
                    <OPTION>Possibility1</OPTION>
                    <OPTION>Possibility2</OPTION>
               </SELECT>
          </body>
     </html>


This page might help you.
0
 
LVL 4

Accepted Solution

by:
vindevogel earned 80 total points
ID: 6850574
Or with Javascript, in case Webwoman sees this question, and says VBScript is for the kids.

<script language=javascript>
function SetTextbox()
{     window.document.forms(0).txtBox.value = select1.options(select1.selectedIndex).text;
}
</script>
0
 

Author Comment

by:hannes1
ID: 6855876
I aplogise for taking so long.

Thanks

Hannes
0
 
LVL 4

Expert Comment

by:vindevogel
ID: 6855906
No problem, thanks for the points
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question