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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass form info to popup with textual link 1

Status
Not open for further replies.
Aug 1, 2003
85
0
0
US
Hi all,

I'm doing yet another "printer friendly" page. Instead of making it dynamic I would prefer to have a link that posts hidden form data to a popup window. And also a printer Icon in that window that inititates the print. I've gotten the popup to work and the form data to post, but not at the same time.


Here's my buggered code...

<form ACTION="cerfformprint.asp" METHOD="POST" name="form4" id="form4">
<input type="hidden" name="Budget_Number" value="test1">
<input type="hidden" name="Reason_for_Request" value="test2">
<input type="hidden" name="cort_comm" value="test3">
</form>

<a href="#" onclick=" window.open(this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); document.form4.submit(); return false; ">Printer Friendly</a>

Thanks in advance,
Dan
 
Not sure I understand. Cerfformprint is the popup page and my issue is getting form data to it. Are you saying pass a variable and pull from the database by that variable??

Dan
 
Aaah sorry - I mis-understood your intentions from reading your code rather than you post.

From your code, it's not obvious that that is what you wanted, because that's not what you're asking the browser to do. If you want to submit to the popup window, you would use something like this:

Code:
<a href="#" onclick="f = document.forms['form4']; f.target = 'popupwindow'; window.open(f.action, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); f.submit();">Printer Friendly</a>

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top