Announcement

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

#1 2006-06-15 12:10:36

taproot_randall
New member
Registered: 2006-06-15
Posts: 4

Xinha and other form elements - play nicely?

I have installed the Xinha editor and for the most part understand how to configure it.

I am integrating it into a CMS and I'm having a bit of trouble.

If I construct a normal form - place some input fields then put xinha below that - when xinha loads it loads over top of my form elements.

So if I had for example:


[ FIRST NAME ]

[ LAST NAME ]

[ EMAIL ADDRESS ]

[ XINHA EDITOR ]

when the page loads you just see:

[ XINHA EDITOR ]



for a brief moment in time the form loads above xinha, then xinha quickly jumps up and over top of the form.

Any help?

I had no luck searching or reading through the various materials so far.

I did notice that if I change - var f = document.forms[0]; to

var f = document.forms[5];

that my form displays, but then xinha does not work.


var f = document.forms[0]; - is specifying the form field array - this much I know - but I don't know why xinha stops working if its not set to 0.

Any help is appreciated.

Thank you.

Last edited by taproot_randall (2006-06-15 12:12:52)

Offline

#2 2006-06-15 14:59:58

taproot_randall
New member
Registered: 2006-06-15
Posts: 4

Re: Xinha and other form elements - play nicely?

update:

if i pull the fields outside of the form tag - all is well - obviously this is not ok -

i also have concerns about how the entire group of data will submit - will i be able to use POST for everything?

thank you.

Offline

#3 2006-06-15 15:15:40

taproot_randall
New member
Registered: 2006-06-15
Posts: 4

Re: Xinha and other form elements - play nicely?

Problem appears to be solved.  Here was the solution.

In the .js file look for:
  var f = document.forms[0];
  f.innerHTML = '';

and change to:

  var f = document.getElementById('editors_here');
  //f.innerHTML = '';


Initially the javascript calls the form element and tries to wipe its contents and inject new html content via innerHTML.

Once this is completed it essentially replaces all content within the form with the xinha text editor.

By commenting out the f.innerHTML line you are not allowing the script to blank out your current form HTML.

Then by using the id of the div that contains your text editor (in this case "editors_here") instead of the generic all-encompassing forms[0] you are able to contain all text editor rewriting within the confines of that div.

doing the above grants me working code.

i hope it helps someone.

thank you.

Last edited by taproot_randall (2006-06-15 15:16:23)

Offline

#4 2006-06-25 23:26:48

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

Re: Xinha and other form elements - play nicely?

Looks like you took the code from the example.  You should simply follow the NewbieGuide


James Sleeman

Offline

Board footer

Powered by FluxBB