SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing vars from window to window ..how ?

    hi ..

    i have 2 file..
    the 1st file have this code :
    Code:
    document.write('<form name=\"fHtmlEditor\" method=\"GET\" action=\"\">');
    document.write('<textarea name=\"EditorValue\" style=\"display: none;\">' + editorvalue + '</textarea>');
    and there button when onclick will open new window, i need to pass vars from there to the opener window !

    Code:
    <script>window.opener.document.fHtmlEditor.EditorValue.value="dcd";</script>
    i got no error and no result !

    SO HOW PLZ !!

  2. #2
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think i found the ...

    when the fisrt page will open new pop-up windows(a.htm), then in a.htm there are new button, onclick will open another windows (b.htm)...

    i need to pass some vars from a.htm to b.htm ...

    HOW !

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well its simple
    PHP Code:

    NewWin 
    window.open('',"process2");
    NewWin.document.write ('this is my first win<br>'); 
    a better example
    PHP Code:
    <html>
    <
    head>
    <
    title>:)</title>
    <
    script>
    function 
    ViewWindow(opensizeWsizeHtextboxAtextboxB) {
        if (
    open == "true"//open is a switch (boolean)
        
    {    
            var 
    NewWindow window.open('',"process","width=" sizeW ", height=" sizeH ", , statusbar=0, menubar=0"); 

            
    with (NewWindow)
                {
                    
    with (document)
                        {
                            
    write("\n\n\n<html>\n");
                            
    write("<head>\n\n");
                                    
                            
    title "Image Name";

                            
    bgColor     =    "black";
                            
    fgColor     =    "red";
                            
    linkColor     =    "red";
                            
    alinkColor     =    "red";
                            
    vlinkColor     =    "red";
                        
                            
    write    ("<style>\n\n");
            
                            
    write    ("a:hover {\n");
                            
    write    ("color: 000000;\n");
                            
    write    ("background-color: #FFFFFF\n");
                            
    write    ("}\n\n");

                            
    write    ("color: #000000;\n");
                            
    write    ("background-color: #FFFFFF;\n");
                            
    write    ("cursor: default;\n");
                            
    write    ("}\n\n");
                        
                            
    write    ("</style>\n\n");
                            
                            
    write("</head>\n");
                            
    write("<body topmargin='0' leftmargin='0'>\n\n");
                            
    write ("<br>");
                            
    write ("textbox value 1 = " textboxA);
                            
    write ("<br>");
                            
    write ("textbox value 2 = " textboxB);
                            
                            
    write("</body>\n");
                            
    write("</html>\n\n\n");
                }
                
    //focus();
            
    }
        }
        
        else
        {
            
    //alert (open)
        
    }
    }
    </script>
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1" method="post" action="javascript:ViewWindow('true', 200, 200, document.form1.textfield.value, document.form1.textfield2.value);">
      <input type="text" name="textfield" value="a">
      <input type="text" name="textfield2" value="b">
      <input type="submit" name="Submit" value="Submit" onclick="this.focus">
    </form>
    </body>
    </html> 
    Last edited by Andrew-J2000; Apr 8, 2002 at 09:30.

  4. #4
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm...

    maybe u i didn`t undersyand ur example !

    i have 3 html page (a.htm , b.htm , c.htm)

    in a.htm there button, onlick will open b.htm , and also there link in b.htm, onclick will open c.htm, i need to pass vars from c.htm to b.htm !

    as i know i must use window.opener.Form_name.Input_name.value

    this cmd wrok if i pass vars from b.htm to a.htm, but since i have 2 opener window doesn`t work here .

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    erm are all the windows popups btw

  6. #6
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think the problem is bigger than this


    what am trying to make image uploader for WYSYWIG script, that there are button onclick will pop-up windows with uploader.php, after chossing the img i need to pass the image name to the textarea for the WYSYWIG .

    but it`s hard since it include the textarea and another vars from another filr with iframe !

    hmmm ...
    if go to this site http://www.innovationd.com/admin/_login.cfm

    to the admin content link, will be there WYSYWIG editor, try to insert image... u will see what i mean !

  7. #7
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohh ..
    user : demo
    passwd : demo

  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol what happens next if you cant use " or ' when you need to use document.write lol

    Code:
    <script>
    
    	p = '<script>';
    	p+= 'function pop_up_wins(url,name_of_win)';
    	p+= '{';
    	p+= '	winC = window.open(url, name_of_win);';
    	p+= '	winC.document.write(\'<input type="text" name="input">\');';
    	p+= '	winC.document.write(\'<input type="button" name="btn" input="pass info" onclick=\"winB.document.write (\'helloo\')\">\');';
    	p+= '}';
    	p+= '</sc' + 'ript>';
    	p+= '<input type=\"button\" onclick=\"pop_up_wins(\'c.html\',\'window_c\')\" value=\"open c\">';
    	
    	function pop_up_wins(url,name_of_win)
    	{
    		winB = window.open(url, name_of_win);
    		winB.document.write (p);
    	}
    
    </script>
    
    <input type="button" onclick="pop_up_wins('b.html','window_b')" value="open B">
    thats what i have so far, i just cannot think at the moment so that might get you going for now, but if not i will have another go later

    ps nice site btw
    Last edited by Andrew-J2000; Apr 9, 2002 at 02:51.

  9. #9
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for sum reason the forum keeps playing about with the escaped characters. So you will have to check it out

  10. #10
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don`t think this will work ...

    i think u cann`t get what i mean, or maybe i cann`t explaint with writing!
    what about if i send to u the files without images, its about 50kb !

    then just try to put link with will pop-up windows and from there pass the vars ..

    ??

  11. #11
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  12. #12
    SitePoint Guru Richi's Avatar
    Join Date
    Jul 2001
    Location
    Hu,Bp.
    Posts
    842
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    send it ..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •