You are not logged in.
Greetings,
I have Xinha setup, and working -- at least, it looks like it's working. The problem I'm having, however is that when the page loads, and I focus the textarea containing Xinha, the status icon in Firefox (that little dotted circle in the top right corner underneath the close X button) begins animating, like Firefox is trying to download something. In addition, if I try to alert the contents of the textarea after typing something in, I always get an empty string. Here's the simplified code that demonstrates this for me:
<HTML>
<HEAD>
<TITLE>Edit Story</TITLE>
<SCRIPT TYPE="text/javascript">
_editor_url = "/xinha/" // (preferably absolute) URL (including trailing slash) where Xinha is installed
_editor_lang = "en"; // And the language we need to use in the editor.
</SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="/xinha/htmlarea.js"></SCRIPT>
<SCRIPT TYPE="text/javascript">
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
xinha_plugins = xinha_plugins ? xinha_plugins : [];
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors : ['story'];
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
HTMLArea.startEditors(xinha_editors);
}
window.onload = xinha_init;
</SCRIPT>
</HEAD>
<BODY>
<TEXTAREA ID="story" NAME="story" ROWS="10" COLS="10"></TEXTAREA>
<INPUT TYPE="button" VALUE="Show Preview" onClick="alert(document.getElementById('story').value);">
</BODY>
</HTML>
When I click the Show Preview button, I get an empty message box. What's causing the browser to act like it's doing something when I focus the textarea, and why am I getting an empty message box (after typing some text into the textarea, and clicking the show preview button)?
Any ideas? I'm sure this worked at one time, so I figure something is screwed up on my end, but I don't know what. I've re-installed Xinha, but still get the same thing, and it's happening in both IE and Firefox.
Thanks,
Aaron
Offline
While editing the value of the textarea is not changed, this can be done manually by calling the form's onsubmit method, you you can directly get the value from the editor
<INPUT TYPE="button" VALUE="Show Preview" onClick="this.form.onsubmit(); alert(document.getElementById('story').value);">
or
<INPUT TYPE="button" VALUE="Show Preview" onClick="alert(xinha_editors.story.outwardHtml(xinha_editors.story.getHTML())">
I'd like to know, too, why and what seems to be loading all the time...but I have no idea
Offline
Thanks, ray. That works perfectly. I swear I had it working my way previously, but alcohol may have been involved.
Firefox is still acting like it's downloading something as soon as the edit area gets focus, but it doesn't appear to impact anything.
Thanks again,
Aaron
Offline