Announcement

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

#1 2005-06-17 06:49:30

mrwaveydavey
New member
Registered: 2005-06-17
Posts: 3

Xinha in a form - doesnt seem to work?

Hi,

When I try and load xinha within a table as part of an admin system form, it doesnt seem to work. If I place it on its own on the page its fine. Any suggestions on how to get it working in a table? Im using Firefox. But it seems the same in IE.

cheers, Dave

Offline

#2 2005-06-17 07:13:15

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Xinha in a form - doesnt seem to work?

What errors?  Post a URL please.


James Sleeman

Offline

#3 2005-06-17 07:38:47

mrwaveydavey
New member
Registered: 2005-06-17
Posts: 3

Re: Xinha in a form - doesnt seem to work?

I do not get any errors as such, I'm guessing the instance doesnt initialise... presumeably caus it cant 'find' it on the page.?

Here is the testbed file. I created a 2x2 table and put the textarea in one of the cels. I've changed nothing else. if it is removed from the table it works. Any clues?

http://www.pyramid-design.co.uk/xinha/e … stbed.html

cheers.


oh.. I've just noticed i've named the post incorrectly too, i meant to say 'xinha in a table' (not form!) sorry!.

Last edited by mrwaveydavey (2005-06-17 07:49:07)

Offline

#4 2005-06-17 14:53:10

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Xinha in a form - doesnt seem to work?

I wrapped your table around the textarea in my own testbed file and it works fine.  I see you are using a slightly older version, can you try updating and give it another go please.

Also try removing the doctype and see if that makes any difference (although I tried it with your doctype as well and it worked).


James Sleeman

Offline

#5 2005-06-17 20:44:13

mokhet
Xinha Authority
From: Paris, France
Registered: 2005-04-03
Posts: 105
Website

Re: Xinha in a form - doesnt seem to work?

Did you read the NewbieGuide before trying your own version ?

You need to make sure the textarea you want to convert has the "id" set, such as

<textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>

it can be the same as the name - just make sure there is only one thing on the page with that ID though!

The problem is not related to the table layout. It is in the javascript and the ID of the textarea.

/** STEP 2 ***************************************************************
* Now, what are the names of the textareas you will be turning into
* editors?
************************************************************************/

xinha_editors = xinha_editors ? xinha_editors :
[
  'myTextArea'
];
<textarea id="textarea" name="myTextArea" style="width:100%;height:320px;">

The javascript is looking for a textarea with the ID myTextArea but doesnt find it. The name is not used, only the ID is meaning something for Xinha.

change your textarea to

<textarea id="myTextArea" name="MyNameIsNotRelatedToXinha_Only_my_ID_is" style="width:100%;height:320px;">

can we use this patch to avoid another confusion of this kind ?

Index: full_example-body.html
===================================================================
--- full_example-body.html    (revision 235)
+++ full_example-body.html    (working copy)
@@ -39,7 +39,7 @@
     xinha_config  = null;
     xinha_plugins = null;
 
-    // This contains the names of textareas we will make into Xinha editors
+    // This contains the ID of textareas we will make into Xinha editors
     xinha_init = xinha_init ? xinha_init : function()
     {
       /** STEP 1 ***************************************************************
@@ -64,7 +64,7 @@
              if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
 
       /** STEP 2 ***************************************************************
-       * Now, what are the names of the textareas you will be turning into
+       * Now, what are the ID of the textareas you will be turning into
        * editors?
        ************************************************************************/
 
@@ -181,4 +181,4 @@
 
 
 </body>
-</html>
+</html>
\ No newline at end of file

Offline

#6 2005-06-17 23:18:06

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Xinha in a form - doesnt seem to work?

Good catch mokhet smile


James Sleeman

Offline

#7 2005-06-20 06:23:44

mrwaveydavey
New member
Registered: 2005-06-17
Posts: 3

Re: Xinha in a form - doesnt seem to work?

Thanks for your time on this guys..

Its turned out to be a version problem.

I had read the newbie guide and understood about id etc, (I have used it successfully before, but not within a table. As soon as I placed it in a cell, it died.)

I have downloaded the latest version though, uploaded it, and the page in question fires up fine.

thanks again smile

Offline

Board footer

Powered by FluxBB