Ver Mensaje Individual
  #32 (permalink)  
Antiguo 21/11/2002, 17:20
Avatar de RootK
RootK
Moderador
 
Fecha de Ingreso: febrero-2002
Ubicación: México D.F
Mensajes: 8.004
Antigüedad: 23 años
Puntos: 50
Ups.. creo que no ando bien... ya introduje todo lo que me pasate zeus_bsas pero no me regresa el cursor... te paso el code que tengo y te o les agradecería me dijeran que está mal:

<SCRIPT Language="JavaScript">
<!--

var text = "";
function storeCaret(text) {
if (text.createTextRange) {
text.caretPos = document.selection.createRange().duplicate();
}
}


function AddText(text) {
if (document.formu.a1.createTextRange && document.formu.a1.caretPos) {
var caretPos = document.formu.a1.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
text + ' ' : text;
}
else document.formu.a1.value += text;
}

function ingresar(text)
{
var campo=document.form1.mensaje;
if (campo.createTextRange && campo.caretPos)
campo.caretPos.text=campo.caretPos.text.charAt(cam po.caretPos.text.length - 1) == ' ' ? text + ' ' : text;
else
campo.value+=text;
campo.focus(campo.caretPos);
}
</SCRIPT>

</SCRIPT>
</head>
<body>
<form method=post name=formu action="">
<textarea name="a1" rows="20" cols="20" ONSELECT="storeCaret(this);" ONCLICK="storeCaret(this);" ONKEYUP="storeCaret(this);"></textarea>
<a href="javascript:AddText('');">Sonrisa</a>
</form>


Gracias nuevamente