Click to See Complete Forum and Search --> : pass data from dropdown to textbox?


shasha
02-06-2004, 11:43 AM
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.

aaroncohn
02-09-2004, 09:12 PM
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):


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.

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.

shasha
02-11-2004, 12:56 PM
Thanks! I'll give it a look.