on my page, I have a drop down list, with quite a few choices for the user, and a text box. Once the user clicks on a choice, I would like that text to be put into the text box. Any help greatly appreciated!<br><br>thanks
This is a javascript question not an asp question so you should go to a javascript forum. But I'll outline one possible way to do this anyways. In the select tag of the HTML page you need to put an onChange statement which calls a javascript function:<br><br><select name=thelist onChange="putValueInBox();"><br><br>Then the javascript function needs to get the value of the selection list and put it in the text area:<br><br>function putValueInBox()<br>{var listvalue = document.thenameofyourform.thelist.value;<br>document.thenameofyourform.thenameofyourtextarea.value += listvalue;}<br><br>Something like this should work. Note a script like the one above might not work in some Netscape browsers because the selection list doesn't automatically inherit it's selected option value which means you might have to write something like:<br><br>document.theform.thelist.options[document.theform.thelist.selectedIndex].value<br><br>I do pretty complicated movement of values around form elements all the time for site management tools so if you can't figure it out from this email me your script and I can take a look at it.<br><br><A HREF="mailto:wduty@radicalfringe.com">wduty@radicalfringe.com</A>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.