htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
[Parent/child windows communication trouble] opening htmlarea in a popup


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


ronnie98
Novice

Aug 20, 2004, 10:16 AM

Post #1 of 6 (952 views)
Shortcut
[Parent/child windows communication trouble] opening htmlarea in a popup Can't Post

Hi all i have a form (myform) with a standard textarea (mytextarea)
and a link beside the form to open htmlarea3 in a popup and edit
the content of the textarea.

In the popup i have this code to load the content from "mytextarea" (parent window)
into htmlarea (child window):

<script type="text/javascript">
document.forms.form_name.textarea_name.value = opener.document.forms.myform.mytextarea.value
</script>

and the code above works so the content is correctly transfered into htmlarea

I have another function to send the content of the textarea back to "mytextrarea":

<script type="text/javascript">
function updateTextarea()
{
opener.document.forms.myform.mytextarea.value = document.forms.form_name.textarea_name.value;
window.close()
}
</script>

The form on the child window (where htmalrea is built) is:

<form action=..... method=post name="form_name">
<div><textarea id="editor" class="textarea" name="textarea_name" rows="30" cols="60"></textarea></div>
<input class="button" type="button" value="Ok" onClick="updateTextarea()">
<input onclick="window.close()" type=button value="Cancel">
</form>

For some strange reason when i click the OK button,the popup close
but the content in the original textarea (mytextarea) is not updated.
I guess i have to fix something.
Can you give me a helping hand?
Thanks in advance,ronnie.


Denver Dave
User

Aug 20, 2004, 1:20 PM

Post #2 of 6 (944 views)
Shortcut
Re: [ronnie98] [Parent/child windows communication trouble] opening htmlarea in a popup [In reply to] Can't Post

I have been working on the same functionality:
http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Beta_Release_F14/Use_only_enlarge_editor_option__P33035/

What is the exact syntax of your link to open htmlArea in a popup window?

With inspiration from you, I'll take another look at it. Thanks - please post any progress.

If we are going to do a popup, we might as well do a fullscreen window (fullscreen.html) - then we have issues supplying the values that would normally be pulled from the initiating htmlarea window (now poping up from standard html textarea): (Assume standard HTML form is in the examples subdirectory for now.)

This does not work in the popup fullscreen.html, but you can see where I'm trying to go:

<!-- hack -->
<script type="text/javascript">
document.forms.form_name.textarea_name.value = opener.document.forms.myform.mytextarea.value
</script>

<script type="text/javascript">
// _editor_url = window.opener._editor_url;
// _editor_lang = window.opener._editor_lang;
_editor_url = "../";
_editor_lang = "en";
var BASE = window.opener.document.baseURI || window.opener.document.URL;
var head = document.getElementsByTagName("head")[0];
var base = document.createElement("base");
base.href = BASE;
head.appendChild(base);
</script>

<script type="text/javascript" src="../htmlarea.js"></script>

<script type="text/javascript">
// load HTMLArea scripts that are present in the opener frame
// ***** definitely have to do something with below:
var scripts = window.opener.HTMLArea._scripts;
for (var i = 4; i < scripts.length; ++i) {
document.write("<scr" + "ipt type='text/javascript' src='" + scripts + "'></scr" + "ipt>");
}
</script>


(This post was edited by Denver Dave on Aug 20, 2004, 1:45 PM)


ronnie98
Novice

Aug 20, 2004, 7:15 PM

Post #3 of 6 (936 views)
Shortcut
Re: [Denver Dave] [Parent/child windows communication trouble] opening htmlarea in a popup [In reply to] Can't Post


Quote
What is the exact syntax of your link to open htmlArea in a popup window?

It's a simple window.open function but i think the triggering link should not matter with the value tranfers.
But i may be wrong.
I still haven't found a solution.
Hope we can help each other finding the answer...


Denver Dave
User

Aug 21, 2004, 4:57 PM

Post #4 of 6 (917 views)
Shortcut
Re: [ronnie98] [Parent/child windows communication trouble] opening htmlarea in a popup [In reply to] Can't Post

Are you opening popups/fullscreen.html ?


ronnie98
Novice

Aug 21, 2004, 6:28 PM

Post #5 of 6 (915 views)
Shortcut
Re: [Denver Dave] [Parent/child windows communication trouble] opening htmlarea in a popup [In reply to] Can't Post


In Reply To
Are you opening popups/fullscreen.html ?

No i have a custom page (popups/images.html) which is included in htmlarea + imagemanager by zhuo that you can find here: http://www.zhuo.org/htmlarea/.
I think the key of our problem resides in the fact that the child window sends data out of the form in the parent window.
I have no errors from my firefox javascript console so i'm not able to find what i have to fix.
No errors = it works
but it's not my case i have no errors but the data are not send back to the parent form.
It's very strange!


ronnie98
Novice

Aug 22, 2004, 9:20 AM

Post #6 of 6 (909 views)
Shortcut
Re: [ronnie98] [Parent/child windows communication trouble] opening htmlarea in a popup [In reply to] Can't Post

I just discovered that it works when i edit the content in "TEXT MODE" so the content is correctly transfered to parent form.
It still doesn't work when i'm in "WYSIWYG MODE".
Help is needed!

 
 
 


Search for (options)