You could do it with something like this:
<html>
<head>
<title>test</title>
<Script Language="JavaScript">
<!--
function trim(string)
{
fixedTrim = "";
lastCh = " ";
for (x = 0; x < string.length; x++)
{
ch = string.charAt(x);
if ((ch != " "

|| (lastCh != " "

)
{
fixedTrim += ch;
}
lastCh = ch;
}
//alert('Before:' + fixedTrim - 1);
if (fixedTrim.charAt(fixedTrim.length - 1) == " "

{
fixedTrim = fixedTrim.substring(0, fixedTrim.length - 1);
// alert('After:' + fixedTrim);
}
if(fixedTrim == '')
{
//alert('Please enter a color.');
}
else
{
nameditem = fixedTrim;
insert(nameditem);
//return fixedTrim;
}
}
function insert(nameditem)
{
if (document.frmTest.txt1.value != '' || ' ')
{
var newOption = document.createElement("OPTION"

;
newOption.text = nameditem;
newOption.value = nameditem;
document.frmTest.select1.add(newOption);
document.frmTest.txt1.value = "";
document.frmTest.txt1.focus();
}
else
{
alert('Please insert a value.');
}
}
function colors(selCol)
{
document.bgColor = selCol;
}
//-->
</Script>
</head>
<body>
<Form name="frmTest">
<input type=text value='' name="txt1">
<input type=button value=insert onclick="JavaScript:trim(txt1.value);document.frmTest.txt1.focus();">
<br>
<select name="select1" onChange="colors(this.value);document.frmTest.txt1.focus();" STYLE="WIDTH: 205px;">
<Option><------Choose Here-------></Option>
</select>
</Form>
</body>
</html>