Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    passing value problem

    I'm trying to passing values between 2 pages it works when I open page2.html in another frame(mainFrame), but when I want it to open in the same frame(leftFrame) it dosn't work??


    Code:
    source.html (in leftFrame)
    
    <head>
    <script language="JavaScript" type="text/javascript">
    <!--
    
    function newWindow(file,window) {
        msgWindow=open(file,window,'');
        if (msgWindow.opener == null) msgWindow.opener = self;
    }
    //-->
    </script>
    <body>
    <form name="form1a" id="form1a">
        <input name="textfield" type="text" value="10" />
        <input name="textfield2" type="text" value="20" />
    
        <input type="button" value="Open New Window" onClick="newWindow('page2.html','leftFrame')">
    </form>
    </body>
    
    
    page2.html( to open in the same frame)
    <head>
    <script language="JavaScript"><!--
    var etta = opener.document.form1a.textfield.value;
    var tvoa = opener.document.form1a.textfield2.value;
    function value() {
       
    	document.form1.textfield.value=etta;
    	document.form1.textfield2.value=tvoa;
      
      }
    //--></script>
    
    
    </head>
    
    <body onload="value()">
    <form id="form1" name="form1" method="post" action="">
      <input name="textfield" type="text" readonly="1" />
      <input name="textfield2" type="text" readonly="1" />
    </form>
    
    
    </body>
    Last edited by JohnnyD; 05-02-2006 at 06:33 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    To open in the same window you would probably have to use the query string

    The information here may help you.

    http://www.huntingground.freeserve.c...ta/p_data1.htm
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up



    Thank you MR J

    I belive that will help me.

    You saved my day

    JohnnyD


  •  

    Posting Permissions

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