Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/03/2010, 13:57
Avatar de pichichus14
pichichus14
 
Fecha de Ingreso: marzo-2010
Ubicación: Entre Ríos
Mensajes: 46
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: copiar y pegar a otro campo solo una parte del texto

la verdad no conozco mucho par que sirve lastIndexOf. Ya lo resolví hice esto:

<html><head>
<script language="javascript">
function copiar(fuente, destino)
{ document.getElementById(destino).value= "{youtube}"+(document.getElementById(fuente).value .substring(31,42))+"{/youtube}";
}
</script>

</head><body>

<form>
<input name="campo1" type="text" id="direccion">
<input type="button" value="Copiar" onClick="copiar('direccion', 'video');">
<input name="campo2" type="text" id="video">
</form>

</body></html>