Click to See Complete Forum and Search --> : pass multiple parameters to new window


djmc48
02-23-2003, 11:13 PM
hey everyone,

i havent had much experience with javascript, so im not quite sure what to do here... here is what im trying to do: i have a form with multiple variables which i am trying to pass to a separate page, and i can get it to submit properly when the page that recieves the variables replaces the one in the same window. when i try to make it open in a different window using a javascript function, it will not pass my extra parameters...any suggestions?

here is an example of what im trying to do...

<form name='myform' action='preview.cgi'>
<input type='submit' name='preview' value='Preview Page'>
<input type='hidden' name='v1' value='$var1'>
<input type='hidden' name='v2' value='$var2'>
</form>

thanks,

dj

khalidali63
02-23-2003, 11:32 PM
Try these links and see this is any thing you want to do.

http://68.145.35.86/skills/javascripts/DemoForwardFormDataViaURL.html
http://68.145.35.86/skills/javascripts/ParentWinInteractionWithChildWin.html

cheers

Khalid

djmc48
02-24-2003, 02:51 PM
thanks very much guys it works great now!

dave :D

igneramos
03-06-2003, 12:42 PM
ok, here's a variation that's got me stumped:


<form name="redirect" method="post" action="viewcard.php" target="myWin"
onsubmit="newWin=window.open('',this.target,'toolbar=no,status=no,menubar=no,
directories=no,status=no,height=500,width=750,scrollbars,resizable');">
<input type="hidden" name="card" value="<?php echo"$card";?>">
<input type="hidden" name="session" value="<?php echo"$session";?>">
<input type="submit" name="submitme" value="Show Card">
<a href="#" onclick="javascript:document.redirect.submit();">open window</a>
</form>


this is for a fairly simple postcard solution that sends an email with a link to the card. since the idea is that we want to drive traffic to the site (it's for a photographer's site), ultimately what i want to accomplish is to have this page load, and submit the form on load, opening the card in a new window, then redirecting this window to the site. everything's working EXCEPT the window features.

the submit button works as expected, opening a new window with the appropriate window features. the link version does not. as best as i can tell, it's simply opening the target, ignoring the window.open().

i'm mostly a hack when it comes to javascript, so any help would be appreciated.