SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Albany, N.Y.
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pass value from child form to parent form

    I am trying to pass the value form a child form that was called from a parent form and having difficulty.

    The child form is set like this

    Code:
    <form name="frmReq" onSubmit="passVals()" >
    
    </form]
    In the head the child form html doc I have

    Code:
    <script>
    function passVals() {
    
       document.appts.req_f_name.value ='testing';
       //appts is the name of the parent form
      //req.f_name is the name of a text box on the parent form
    
    
    }
    </script>

    the parent form/window calls the child window using

    Code:
    <p><a href="javascript:winReq()">Select Requester</a></p>
    This is the javascript for the winReq function

    Code:
    function winReq() {
    	var url='req.php'
    	var width=230;
    	var height=245;
    	var from_top=350;
    	var from_left=500;
    	var toolbar='no';
    	var location='no';
    	var directories='no';
    	var status='no';
    	var menubar='no';
    	var scrollbars='no';
    	var resizable='no';
    	var atts='width='+width+'show,height='+height+',top='+from_top+',screenY=';
    	atts+= from_top+',left='+from_left+',screenX='+from_left+',toolbar='+toolbar;
    	atts+=',location='+location+',directories='+directories+',status='+status;
    	atts+=',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable;
    	win=window.open(url,'win_name',atts);
    }

    I would like to know what I am missing or any ideas?

    THanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Albany, N.Y.
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I got it I had to add .document

    window.opener.document.appts.req_f_name.value ='testing';


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
  •