Re: pop-up

From: Date: Sun, 18 Aug 2002 07:22:11 +0000
Subject: Re: pop-up
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113121@lists.php.net to get a copy of this message
You need to modify topWindow() so that you can pass a query string to it, which you can then use to add to the URL of the pop-up window. <SCRIPT> <!-- function userpop(user_id) { var prefix = "show_user.php?userid="; var script = eval("prefix + user_id"); window.open(script, "view_user", "toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes ,resizable=no,width=250,height=250"); } // --> </SCRIPT> <input type=BUTTON value=Preview onClick="userpop('justin');"> This would pop-up a window with the dimensions listed, and I pass a userid to it, which gets appended to the URL of the new window, passing a userid variable into the target script via GET. I *think* all <input>'s need to be in a form tag regardless... a better way to test your script would be to take the input/form out of the equation, get your javascript right with a simple <A HREF> tag: <A HREF="#" onClick="userpop('justin');"> And since this is a JavaScript thing, not a PHP thing, you might want to address the issue(s) in comp.lang.javascript Justin French on 18/08/02 7:14 PM, Mantas Kriauciunas (Mantuks@attbi.com) wrote: > Hey php-general, > > whats the easyest way to send variables to pop-up? > > i got button like this: > <input type=BUTTON value=Preview onClick=\"topWindow()\" > > its not in the <form> its just standing hare.. do i add to post or > how is the easy way to do it.. it just pops up window and i need > to pass variables to that pop up whish takes variables from the form > before that button. its preview.php that pops out.

« previous php.general (#113121) next »