Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2008-06-02 17:07:29

Random Bits
Xinha Community Member
Registered: 2005-10-24
Posts: 19

Causing Xinha to refresh the textarea

I have an AJAX spell checker which embeds a lot of span tags. The spell checker does have a function to remove these tags, but there is a timing issue.

If I click on a submit button, then Xinha puts its contents back into the textarea ready to be sent to the server (maybe onBlur?)

However the spell checker's cleanup code does not run until after Xinha has placed its content. The cleanup runs on Xinha's iframe, cleans it up, but because the content has already been transferred the cleaned up text does not get sent.

So, is there a way to force Xinha to replace the textarea text on demand?

That way I could run the cleanup code, then have Xinha place the text into the textarea, which will then be sent back to the server.

Offline

#2 2008-06-07 10:16:45

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Causing Xinha to refresh the textarea

//get the HTML
html = editor.getEditorContent();
//set the HTML
editor.setEditorContent(html);

Offline

#3 2008-06-23 18:11:43

Random Bits
Xinha Community Member
Registered: 2005-10-24
Posts: 19

Re: Causing Xinha to refresh the textarea

Ok, so:

document.formID.textareaID.value = editors['textareaID'].getEditorContent();

should work?

I tried the above code, but it dies. I can retrieve the document.formID.textareaID.value into an alert, but the code does not run past the statement.

Offline

Board footer

Powered by FluxBB