Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/11/2006, 03:57
CARLOS.asp
 
Fecha de Ingreso: noviembre-2006
Ubicación: BARCELONA
Mensajes: 30
Antigüedad: 17 años, 6 meses
Puntos: 0
Funcion copyit

Como se puede evitar en el script siguiente que, cada vez que se selecciona un nuevo texto, se borre el anterior que se habia guardado en el textarea



<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function copyit(theField) {
var selectedText = document.selection;
if (selectedText.type == 'Text') {
var newRange = selectedText.createRange();
theField.focus();
theField.value = newRange.text;
} else {
alert('seleccione texto con el cursor i pulse este botón');
}
}
// End -->
</script>


<input onclick="copyit(this.form.select1)" type="button" value="Selecciona amb el cursor i clica" name="btnCopy">


<textarea rows="3" name="select1" cols="64" tabindex="4"></textarea>