pass value from child form to parent

Discussion in 'JavaScript' started by cedtech31, Dec 29, 2007.

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

    The child form is set like this

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

    
    <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>
    
    Code (markup):

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

    THanks
     
    cedtech31, Dec 29, 2007 IP
  2. cedtech31

    cedtech31 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ok I got it I have to add .document

    window.opener.document.appts.req_f_name.value ='testing';
     
    cedtech31, Dec 29, 2007 IP