Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Form parameters to new window 1

Status
Not open for further replies.

egims

Technical User
Jun 5, 2001
96
US
Sorry to repost this question, but I still haven't found a workable answer and I'm sure one is possible.

I have a form with a few input parameters. When submit is clicked I want the form results to appear in a new window which I can control via this sort of thing:

window.open( qstr,'displayWindow','width=638,height=400,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes, top=20, left=20');

One thing I have tried is passing values to the URL contained in "qstr" above, but that does not seem to work the way I did it because unless I specifically pass the values by hand, I can not seem to get the form to pass the entered values.

I posted a simular question a few posts ago for those who may wish to review it for additional feedback. I would really appreciate some additional help.

Thanks,

Ed
 
you can use the new popup to grab the form values:

window.opener.document.formName.fieldName.value

-hope that helps -Greg :-Q
 
mackey333,

Thanks for your reply.

I am really a JavaScript novist. How could I use the code in your solution to grab the values? That is, how do I make the form create the popup that grabs the values?

Would you be so kind as to include some more code?

Thanks,

Ed
 
ok well then i need the code for your form..not the page just the form -Greg :-Q
 
Hello Ed,

Yolanda gave me this solution.
The HTML part
Code:
<FORM ACTION=&quot;useFormData.html&quot; TARGET=&quot;displayWindow&quot; onsubmit=&quot;putAnswers()&quot; METHOD=&quot;get&quot;>

The JavaScript part
Code:
<SCRIPT>
function putAnswers(){
   window.open(&quot;useFormData.html&quot;, &quot;displayWindow&quot;, &quot;parameters that control the window&quot;)
}
<SCRIPT>

This worked for her when the URL was an ASP page. Maybe it will work in HTML too.

Hope this helps,
Richard
 
rac2,

YES!

Your solution works perfectly. Even in Netscape, which is always an achievement.

Thank you.

Kind Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top