Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/12/2006, 08:06
CARLOS.asp
 
Fecha de Ingreso: noviembre-2006
Ubicación: BARCELONA
Mensajes: 30
Antigüedad: 18 años, 5 meses
Puntos: 0
AÑADIR SALTO DE LINEA A LA FUNCION copyit

Como se puede añadir un salto de linea a la funcion copyit de ete script

<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="Copiar en textarea" name="btnCopy">

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

para que el resultado NO sea : Texto1texto2texto3....

sino :

Texto1
Texto2
Texto3