Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/03/2009, 15:53
cancha
 
Fecha de Ingreso: junio-2007
Mensajes: 75
Antigüedad: 17 años, 8 meses
Puntos: 1
Respuesta: editor con emoticonos...

Cita:
Iniciado por cuchurrumin Ver Mensaje
creo que el textarea por si solo no se podria, haz utilizado algun editor WYSIWYG, como fckeditor o htmlarea o TINY_MCE o abra algunos otros mas, tienen esay mas funcionalidades que te pueden servir.... son gratuitos y faciles de adapatar.
si econtre un editor wysiwyg en jquery, ya tengo el textarea con funcionalidad para q interprete el html pero el problema es cuando quiero agregarle html desde javascript lo ingreso pero no se vizualiza nada este es el codigo q estoy usando...

Cita:
<script src="jquery-1.3.2.min.js"></script>
<script src="jquery.wysiwyg.js"></script>
<script>
$(function()
{
$('#wysiwyg').wysiwyg();
});
function ShowEmoticono(btn){
document.getElementById('wysiwyg').innerHTML +='<img src="'+btn.value+'">';
$("#wysiwyg").val('<img src="'+btn.value+'">');
alert($("#wysiwyg").val());
//alert(btn.value);
}
</script>

<table>
<tr>
<td>
<div style="height:30px;background-color:#CCCCCC;width:300px;">
<button style="background:url(emoticones/alegre.gif);width:32px;height:32px;" type="button" value="emoticones/alegre.gif" onClick="ShowEmoticono(this)"></button>
<button style="background:url(emoticones/alegresingafas.gif);width:32px;height:32px;" type="button" value="emoticones/alegresingafas.gif" onClick="ShowEmoticono(this)"></button>
<button style="background:url(emoticones/loco.gif);width:32px;height:32px;" type="button" value="emoticones/loco.gif" onClick="ShowEmoticono(this)"></button>
<button style="background:url(emoticones/bien.gif);width:32px;height:32px;" type="button" value="emoticones/bien.gif" onClick="ShowEmoticono(this)"></button>
</div>
</td>
</tr>
</table>
<textarea id="wysiwyg"><img src="emoticones/alegre.gif"></textarea>

Última edición por cancha; 27/03/2009 a las 18:50