pass data from dropdown to textbox?

Sharky Forums


Results 1 to 3 of 3

Thread: pass data from dropdown to textbox?

  1. #1
    Tiger Shark shasha's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    869

    pass data from dropdown to textbox?

    I am not a coder or HTML buff. I am pretty good at following directions and beating my head against things until they work though.

    This is for a fantasy football auction draft that will be live using a chatroom. I want to have a
    • text box for a player's name that the user can input
    • drop down box for position
    • drop down for team
    • dropdown for whole dollar amounts
    • drop down for .25 increments

    User presses the submit button and all the data from those fields pass to a textbox on the same page and allows the user to post it to the chat room.

    I can't for the life of me figure out how to get the data from the other fields into the textbox. I am quite sure that it isn't that hard and rather than beat myself I figured one of you smart guys here could point me in the right direction. Any help is appreciated.
    WinXP Pro SP2 ABIT IC7 Intel P4 3.0E 1024M Corsair PC3200 DCDDR ATI AIW Radeon 9800Pro (400/355) 2 Samsung SV1204H 120G HDs AudioTrak Prodigy 7.1 3Com NIC LG GSA-4163B DVD burner LG GCC-4480B DVD/CD-RW burner Elan Vital Greeneger SSM 500W Cooled by Zalman Altec Lansing MX-5021

  2. #2
    Expensive Sushi
    Join Date
    Jan 2004
    Location
    Livermore, CA
    Posts
    18
    Are you using JavaScript? Usually a dropdown box will have a property that contains the value of the selected text. In javascript it looks like this (my javascript is rusty):

    Code:
    form1.dropdown1.options.selectedindex
    ...where selectedindex is what the user selected (careful to make sure it isn't blank).
    Then you apply it to the text box.
    Code:
    form1.text1.value = form1.dropdown1.options.selectedindex
    Now, I'm almost positive that the code up there won't work, but if you go to http://www.pageresource.com, you'll find plenty of tutorials (where I learned to write javascript and html) that'll teach you to do exactly what you want to do.
    Last edited by aaroncohn; 02-11-2004 at 09:35 PM.

  3. #3
    Tiger Shark shasha's Avatar
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    869
    Thanks! I'll give it a look.
    WinXP Pro SP2 ABIT IC7 Intel P4 3.0E 1024M Corsair PC3200 DCDDR ATI AIW Radeon 9800Pro (400/355) 2 Samsung SV1204H 120G HDs AudioTrak Prodigy 7.1 3Com NIC LG GSA-4163B DVD burner LG GCC-4480B DVD/CD-RW burner Elan Vital Greeneger SSM 500W Cooled by Zalman Altec Lansing MX-5021

Posting Permissions

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