SteveSensei
02-15-2006, 04:07 PM
I need to add phrases contained in a select box to a textarea box with a comma between the phrases, like this:
"new, low mileage, air"
I have a script from another post that adds the words, but writes over the previous word:
<html>
<head>
<title>-</title>
<script type="text/JavaScript">
function showText(){
var F, opt;
F = document.oForm;
opt = F.oSel.options;
F.oTxt.value = opt[opt.selectedIndex].text;
}
</script>
</head>
<body>
<form name="oForm">
<select name="oSel" size="3"
onchange="showText()">
<option>lorem</option>
<option>ipsum</option>
<option>dolar</option>
</select>
<textarea name="oTxt" cols="10" rows="5">
</textarea>
</form>
</body>
</html>
I'm an ASP/VBScript programmer, but not a whiz on Javascript. Any help would be greatly appreciated.
"new, low mileage, air"
I have a script from another post that adds the words, but writes over the previous word:
<html>
<head>
<title>-</title>
<script type="text/JavaScript">
function showText(){
var F, opt;
F = document.oForm;
opt = F.oSel.options;
F.oTxt.value = opt[opt.selectedIndex].text;
}
</script>
</head>
<body>
<form name="oForm">
<select name="oSel" size="3"
onchange="showText()">
<option>lorem</option>
<option>ipsum</option>
<option>dolar</option>
</select>
<textarea name="oTxt" cols="10" rows="5">
</textarea>
</form>
</body>
</html>
I'm an ASP/VBScript programmer, but not a whiz on Javascript. Any help would be greatly appreciated.