Announcement

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

#1 2005-09-15 17:54:14

exlibris
New member
Registered: 2005-09-15
Posts: 2

Javascript to insert into TextArea?

Howdy

I am trying to get a child window to write back into the Xinha textarea.  I am using this to automatically insert URLs and images after files and images are uploaded.  It works great in the rest of my application (i.e. when a Pdf is uploaded to my content management system it automatically fills in the "Identifier" field with the url of the uploaded document).  Here is functional code:

<SCRIPT LANGUAGE="JavaScript">window.opener.document.Identifier.value="http://clac.server.admin.state.mn.us/images/Cover.gif" </script>

However I am not sure how to address the Xinha text area.  I have tried a few things which fail (in the attempt #1, below, "Content" is the form field which Xinha is acting on):

<SCRIPT LANGUAGE="JavaScript">window.opener.document.Content.value=http://clac.server.admin.state.mn.us/images/Cover.gif" </script>

<SCRIPT LANGUAGE="JavaScript">window.opener.document.xinha_editors.value=http://clac.server.admin.state.mn.us/images/Cover.gif" </script>


If I turn off Xinha, attempt #1 works.  Any suggestions?

Andrew Koebrick
State of Minnesota, Department of Administration

Offline

#2 2005-09-16 01:29:08

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Javascript to insert into TextArea?

currently you write into the textarea - which is not the contents of the xinha i-frame.

use editor.setHTML() and editor.getHTML() instead

probably this would work:
window.opener.document.xinha_editors['youreditor'].setHTML('blah');


Niko

Offline

#3 2006-05-08 10:45:33

walo_punk
Xinha Community Member
Registered: 2006-03-27
Posts: 12

Re: Javascript to insert into TextArea?

i've used HTMLArea.xinha_editors['text_area'].setHTML('blah'); AND document.xinha_editors['text_area'].setHTML('blah');

but no one works

Offline

#4 2006-05-08 22:53:18

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

Re: Javascript to insert into TextArea?

xinha_editors is not in the document object, try just
  window.opener.xinha_editors['text_area'].setHTML('blah');


James Sleeman

Offline

Board footer

Powered by FluxBB