Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

html

Options
  • 22-05-2002 10:59am
    #1
    Registered Users Posts: 1,098 ✭✭✭


    i need a hand with writing something for a webpage.
    what i need is basically a combo box with a few options in it. when you setect one of the options the information on that option appears in a text box beside the combo box.
    this make sence or am i rambling?


Comments

  • Closed Accounts Posts: 76 ✭✭photty


    you need javascript for something like that. I'm not into JS but sounds like you need a small script that is triggered on selection of the drop down menu. It should read the value of the menu and write this to the named text box. Have a look at any scripts around the web and it should be fairly obvious how to hack something together to do this...


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Here's a quickie:
    <FORM METHOD=POST ACTION="blah.cgi" name="foo">
    	<INPUT TYPE="text" NAME="txtbox">
    	<SELECT NAME="oplist" onChange="foo.txtbox.value=foo.oplist.value">
    		<OPTION VALUE=""></OPTION>
    		<OPTION VALUE="Value 1">Value 1</OPTION>
    		<OPTION VALUE="Value 2">Value 2</OPTION>
    		<OPTION VALUE="Value 3">Value 3</OPTION>
    	</SELECT>
    </FORM>
    
    I'm almost certain that NS will bork at this, and you may need to use the selectedIndex property in a more cross platform version. But that's the basic idea.


Advertisement