View Full Version : Insert text in textbox upon selecting list value
could someone help me to insert a piece of text in a text box when the user selects a particular value in a list field.
08-12-2005, 03:26 PM
At the most rudimentary...
<select onchange="doIt()" ...>
document.formname.elementname.value='some text value';
08-12-2005, 05:12 PM
Nikki is correct, as an addendum this example would insert the value of the select box into the text field.
i have 'yes' and 'no' in the list. I only want the text to be inserted in the textbox when 'no' is selected. how would i do this?
08-14-2005, 01:01 AM
hope this helps
sorry to be of nuisence but when i add the code a error appears which says there is a ')' missing. But i dont know where to put it; please show me where to put it?
08-14-2005, 03:21 PM
Humble apologies, the error was in my code i posted, i missed out the closing ) of the if statement.
thanks mate that totally worked!!
thanks for being patient
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.