Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

html

  • 22-05-2002 10:59AM
    #1
    Registered Users, Registered Users 2 Posts: 1,129 ✭✭✭


    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