<script>  
  function   insertAtCursor(selectId,   selectValue)   {  
  if   (document.selection)   {  
  selectId.focus();  
  sel   =   document.selection.createRange();  
  sel.text   =   selectValue;  
  }  
  else   if   (selectId.selectionStart||   selectId.selectionStart   ==   "0")   {  
  var   startPos   =   selectId.selectionStart;  
  var   endPos   =   selectId.selectionEnd;  
  selectId.value   =   selectId.value.substring(0,   startPos)  
  +   selectValue  
  +   selectId.value.substring(endPos,   selectId.value.length);  
  }   else   {  
  selectId.value   +=   selectValue;  
  }  
  }   
  //   calling   the   function  
  //insertAtCursor(document.formName.fieldName,   'this   value');  
  </script>    
  <form>  
  <textarea      'demo'),"1234")       value=1  'demo'),"1234")       value=2  "color"   size="1">  
      <option   value="Black"  >Black</option>  
      <option   value="Red"  >Red</option>  
      <option   value="Yellow"  >Yellow</option>  
      <option   value="Pink"  >Pink</option>  
      <option   value="Green"  >Green</option>  
      <option   value="Orange"  >Orange</option>  
      <option   value="Purple"  >Purple</option>  
      <option   value="Blue"  >Blue</option>  
      <option   value="Beige"  >Beige</option>  
      <option   value="Brown"  >Brown</option>  
      <option   value="Teal"  >Teal</option>  
      <option   value="Navy"  >Navy</option>  
      <option   value="Maroon"  >Maroon</option>  
      <option   value="LimeGreen"  >LimeGreen</option></select>