Ver Mensaje Individual
  #17 (permalink)  
Antiguo 31/03/2010, 00:09
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 19 años, 10 meses
Puntos: 834
Respuesta: como capturo la variable en un iframe

Cita:
Iniciado por estibaliz2006 Ver Mensaje
de acuerdo en que son obsoletos pero como hago para dar formato (negrita, cursiva, etc...) al textarea????
Sin iframe? Así:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<
html xmlns="http://www.w3.org/1999/xhtml"
<
head
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<
title>Documento sin t&#237;tulo</title> 
<script
function 
formatText(cmd){ 
    
document.execCommand(cmdnullnull); 

function 
insertarImagen(){ 
    var 
u
    if(!(
u=prompt('ingresar url','http://')))return; 
     
document.getElementById('pp').focus(); 
     
document.execCommand("InsertImage",false,u); 
}  
</script> 
</head> 

<body> 
<form action="" method="get"> 
  <input name="input" type="button" onclick="formatText('bold')" value="NEGRITA" /><input name="input" type="button" onclick="formatText('italic')" value="CURSIVA" /><input name="input" type="button" onclick="formatText('underline')" value="SUBRAYADO" /><input name="input" type="button" onclick="insertarImagen()" value="INSERTAR IMAGEN" /> 
</form> 
<div id="pp" contenteditable="true">Este es un texto editable</div> 
</body> 
</html>