Passing data between HTML forms

Results 1 to 3 of 3

Thread: Passing data between HTML forms

  1. #1
    Join Date
    Dec 1969

    Default Passing data between HTML forms

    Hi all . . .<BR><BR>Let&#039;s say I have an HTML form that includes a button that opens a popup window (actually, another HTML form in a new window). I want to be able to pass data from the "popup" window back to the original HTML form. I do NOT want to do this using a "form.submit" and request("fieldname").<BR><BR>First question: is this possible? (Note: I am NOT talking about doing a submit to an ASP; both forms are client-side, and besides, I already know how to do request("fieldname") on the ASP side.)<BR><BR>Second question: if it is possible, what is the syntax? I&#039;m guessing that it&#039;s something along the lines of "window.formname.fieldname.value=whatever" but I am not sure of the exact syntax, and I don&#039;t want to spend all day trying to figure it out.<BR><BR>Thanks in advance for your help . . .

  2. #2
    Join Date
    Dec 1969

    Default R&D opener on (eop)


  3. #3
    Join Date
    Dec 1969

    Default RE: Passing data between HTML forms

    dunno if this is any help, but its an idea......<BR>create a hidden variable on the main form for each variable that is in the popup form. e.g, if the main form asked for your address, and the popup had something like &#060;input type="text" name="surname"&#062; (asking for your surname), you would create &#060;input type="hidden" name="surname" value=""&#062;on the main form.<BR><BR>Then, in the popup form, have an onSubmit function that looks like the following:<BR>(in the form tag)<BR>&#060;form onSubmit="savevals(this)"&#062;<BR><BR>(in the document head)<BR>function savevals(frm)<BR>{<BR> window.opener.mainformname.surname.value = frm.surname.value<BR> <BR> //do this for all value, also put error checking code in here<BR> window.close<BR> window.opener.focus<BR> //to go back to the main form<BR>}<BR><BR>hope this helps

Posting Permissions

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