473,695 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing vars - popup window problem

Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_act ion = "index.$phpEx?p age=downloads";

$download_url = "download.$phpE x";

$hidden_downloa d_vars = '<input type="hidden" name="download_ id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_down load\" value=\"" .
$lang['Download'] . "\" class=\"mainopt ion\" onClick=\"windo w.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,res izable=yes,WIDT H=
400');return false;\" />";
echo '<form action="' . $s_download_act ion . '" method="post">' ;
echo $hidden_downloa d_vars . '' . $u_download;
echo '</form>';
Mar 15 '06 #1
5 2422
Steve wrote:
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_act ion = "index.$phpEx?p age=downloads";

$download_url = "download.$phpE x";

$hidden_downloa d_vars = '<input type="hidden" name="download_ id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_down load\" value=\"" .
$lang['Download'] . "\" class=\"mainopt ion\" onClick=\"windo w.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,res izable=yes,WIDT H=
400');return false;\" />";
echo '<form action="' . $s_download_act ion . '" method="post">' ;
echo $hidden_downloa d_vars . '' . $u_download;
echo '</form>';


This looks more like javascript, not java.

And I don't see any problem with your PHP code. But it looks like there
are problems with your html and javascript.

First of all - the submit button isn't in the form. Why not? Or is
there more you haven't shown us?

Next, I don't see where you're passing the value to the popup window in
your javascript.

Try a javascript newsgroup.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 15 '06 #2
"Try a javascript newsgroup." - nope this is more of an html question.
Maybe try an html newsgroup, as this is a common html mistake...

Anyway, the problem is that you are passing a get variable here
(instead of a post var):

$s_download_act ion = "index.$phpEx?p age=downloads";

which is the wrong way to sumbit a get variable through an html form
anyway. Especially when you declare:

method="post"

The possible solution is to have a hidden field like:

<input type="hidden" name="something " value="$s_downl oad_action">

and then catch that in the popup as:

$s_download_act ion_is=$_POST['something'];

of course, if you wish to use

method="get"

then the above would be

$s_download_act ion_is=$_GET['something'];

Mar 15 '06 #3
d
"Steve" <stuck@need_hel p.co.uk> wrote in message
news:Xn******** *************** *********@195.9 2.193.157...
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window and
displays some information. The problem being is variables value needs to
be passed from the main page to this popup window ... but it isn't. why?
the submit button one the PHP page is

$s_download_act ion = "index.$phpEx?p age=downloads";

$download_url = "download.$phpE x";

$hidden_downloa d_vars = '<input type="hidden" name="download_ id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_down load\" value=\"" .
$lang['Download'] . "\" class=\"mainopt ion\" onClick=\"windo w.open('" .
$download_url . "', '_spdownload', 'HEIGHT=250,res izable=yes,WIDT H=
400');return false;\" />";
echo '<form action="' . $s_download_act ion . '" method="post">' ;
echo $hidden_downloa d_vars . '' . $u_download;
echo '</form>';


Your form is not actually submitting anything. The submit button is
returning false, which will cancel the form being submitted anywhere. You
could replace the submit with a button, have that create a new window, have
the new window (once loaded) call the opening document, and submit the form
to itself. You can specify a name for the window in the javascript that
creates it, and you can specify a "target" in your <form>. It's messy, but
will have you submitting to a pop-up box.

Posting to a pop-up box seems somewhat dirty. :-P
Mar 15 '06 #4
"d" <d@example.co m> wrote in
news:MQ******** **********@text .news.blueyonde r.co.uk:
"Steve" <stuck@need_hel p.co.uk> wrote in message
news:Xn******** *************** *********@195.9 2.193.157...
Hi,

I currently have a problem passing a variable value from one page to
another. Once a form submit button is pressed java pops up a window
and displays some information. The problem being is variables value
needs to be passed from the main page to this popup window ... but it
isn't. why?
the submit button one the PHP page is

$s_download_act ion = "index.$phpEx?p age=downloads";

$download_url = "download.$phpE x";

$hidden_downloa d_vars = '<input type="hidden" name="download_ id"
value="' . $d_id . '" />';
$u_download = "<input type=\"submit\" name=\"get_down load\" value=\""
. $lang['Download'] . "\" class=\"mainopt ion\"
onClick=\"windo w.open('" . $download_url . "', '_spdownload',
'HEIGHT=250,res izable=yes,WIDT H= 400');return false;\" />";
echo '<form action="' . $s_download_act ion . '" method="post">' ;
echo $hidden_downloa d_vars . '' . $u_download;
echo '</form>';


Your form is not actually submitting anything. The submit button is
returning false, which will cancel the form being submitted anywhere.
You could replace the submit with a button, have that create a new
window, have the new window (once loaded) call the opening document,
and submit the form to itself. You can specify a name for the window
in the javascript that creates it, and you can specify a "target" in
your <form>. It's messy, but will have you submitting to a pop-up
box.

Posting to a pop-up box seems somewhat dirty. :-P


I see your point about being dirty! but its only a confirmation window
once the download button is pressed. basically its just saying "The
requested file 'blahblahblah.z ip' will download in the next 3 seconds.

might look at onther way instead ... but thanks anyway.
Mar 16 '06 #5
"Tyxod" <yr****@gmail.c om> wrote in news:1142427614 .295685.117830
@i39g2000cwa.go oglegroups.com:
"Try a javascript newsgroup." - nope this is more of an html question.
Maybe try an html newsgroup, as this is a common html mistake...

Anyway, the problem is that you are passing a get variable here
(instead of a post var):

$s_download_act ion = "index.$phpEx?p age=downloads";

which is the wrong way to sumbit a get variable through an html form
anyway. Especially when you declare:

method="post"

The possible solution is to have a hidden field like:

<input type="hidden" name="something " value="$s_downl oad_action">

and then catch that in the popup as:

$s_download_act ion_is=$_POST['something'];

of course, if you wish to use

method="get"

then the above would be

$s_download_act ion_is=$_GET['something'];


the variable I am trying to obtain is a hidden var

$hidden_downloa d_vars = '<input type="hidden" name="download_ id"
value="' . $d_id . '" />';
which is in the form like this

echo '<form action="' . $s_download_act ion . '" method="post">' ;
echo $hidden_downloa d_vars . '' . $u_download;
echo '</form>';
the get var your on about in the form element is not the var i am trying
to obtain in the popup window. I need the download_id var as above.

will try it as GET anway and see what happens.

thanks.
Mar 16 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2170
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the window and call the form. In this particular instance, a city name is what I have to pass to the form Chapter.htm. <html> <head>
6
7090
by: veganeater | last post by:
Hi Everyone, I was wondering if there was a way to pass a variable to a popup window. The purpose is make it so when a user clicks on a specific region/link of the glossary page, a popup opens with the related description. This is done and is obviously not a concern. However, now I would like to make it so the corresponding row becomes highlighted (changes background colour via DOM). I imagine it can be done, but I'm at a loss for...
29
5010
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the window properly but does not pass the parameter. (this is part of a coldfusion template) <a href="##"
3
1530
by: Dan Nash | last post by:
Hi I want to be able to click an item in a list, and a new window popup. Obviously i would use window.open in javascript within a RegisterClientScript thingy. However, i want to pass the id of the selected list item to the new popup window. SO presumably i cant use RegisterClientScript? How would I go about this, so I can call
3
4061
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a textbox then clicks the button and on page load the child window should grab that val run a query an present the results. Given that I am bouncing between server side controls and client script. I am just having a little trouble passing my textbox...
3
3450
by: michael | last post by:
let me keep it clean, quick and simple. I am passing a variable into another window and am reassigning the value on the new page - window.document...value = opener.document. ....value and am wanting to then use this value within an element of a form on the current page -
1
2276
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function //////////////////////////////////////////////////////////////////////////////////// version 1 : using global variables ////////////////////////////////////////////////////////////////// var _textField, _divColorPicker; // global vars window.onload = function() { _textField = document.getElementById('htxaMessage'); // fill...
12
37853
meenakshia
by: meenakshia | last post by:
hi forum i have read a lot of articles regarding passing data from popup to parent up but i m looking for the opposite that is from parent to popup window pls help me in this regard i have three input fields in parent window and three in popup window parent.htm
12
7353
by: Lahiru778 | last post by:
I require to appear the Name which i click on the "new.php" page in the "Window_open.php" page..I use some Java Script also to accomplish this but I couldn't.. Could you pleas Help ...!!! ----------The Code in "Window_open.php" ------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
0
9116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8990
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8850
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7664
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5839
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4342
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4580
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1977
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.