Foros del Web » Programando para Internet » Javascript »

Verificar TextArea Ckeditor

Estas en el tema de Verificar TextArea Ckeditor en el foro de Javascript en Foros del Web. Buenas... Estoy con un problema a la hora de verificar un TextArea que tiene incluido el maravilloso sistema ckeditor. El problema que tengo que no ...
  #1 (permalink)  
Antiguo 19/05/2011, 16:07
Avatar de Maganius  
Fecha de Ingreso: septiembre-2010
Mensajes: 310
Antigüedad: 13 años, 6 meses
Puntos: 10
Verificar TextArea Ckeditor

Buenas...

Estoy con un problema a la hora de verificar un TextArea que tiene incluido el maravilloso sistema ckeditor.

El problema que tengo que no me funciona el document..value al text area...

Estube leyendo y parece ser que el textarea no tiene datos hasta enviarse al servidor haciendo imposible una verificación vía cliente.

Les pido ayuda ya que no entiendo muy bien lo que hay que hacer o como hacerlo para poder verificar dicho textarea.

Muchas gracias.

Att: Maganius
  #2 (permalink)  
Antiguo 20/06/2011, 11:14
 
Fecha de Ingreso: noviembre-2008
Mensajes: 135
Antigüedad: 15 años, 5 meses
Puntos: 3
Respuesta: Verificar TextArea Ckeditor

Hola Maganius,

tras mucho buscar creo que logré solventar tu problema y el mio.
No sé si del mejor modo pero creo que funciona:

<textarea id="texto_anuncio" name="texto_anuncio"><?php echo $texto; ?></textarea>
<script type="text/javascript">
CKEDITOR.replace( 'texto_anuncio', { toolbar : [['Bold','Italic','Underline'], ['PasteText']], uiColor : '#89d7ee', language : 'es', forcePasteAsPlainText : true });
getvalue = function()
{
var editor = CKEDITOR.instances.texto_anuncio;
var value = editor.getData();
return value;
}
</script>

Y despues donde quieras contolar por JS si han rellnado el textarea, . . .
var texto_anuncio = getvalue();
alert(texto_anuncio);

Espero te sirva. Cualquier cosa comentalo

Etiquetas: ckeditor, textarea, verificar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:23.