473,738 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

posting hidden form data to a popup window

Hi:
Need some working sample code to post hidden form data from a php page
to a new popup window. 540 x 500 centered. The popup that I'm calling
already is formatted and has a TITLE:web-2007.php so what I need to do
is to write the values from the PHP page to that popup in specific
places.

Some of the hidden values are also like this format;

<input type="hidden" name="handling" value="<?php echo $_POST["sub"];
?>">

<input type="hidden" name="email" value="<?php echo $_POST["email"];
?>">

Right now,the hidden input fields are on a PHP page, and I'm calling the
popup from the generated PHP page like so:

<A HREF="javascrip t:void(0);" style="TEXT-DECORATION: none"
onClick="popUpC enteredWindow() ;">&nbsp;<sp an style="color: blue; font-
family: Verdana;">&nbsp ;Click Here &nbsp;&nbsp; </span></span></A></font>

<script language="JavaS cript">

function popUpCenteredWi ndow() {
var iMyWidth;
var iMyHeight;
//gets top and left positions .
iMyWidth = (window.screen. width/2) - (200 + 10);
//half the screen width etc..
iMyHeight = (window.screen. height/2) - (255 + 1);
//half the screen height etc...
var win2 = window.open("we b-2007.php","Wind ow2","status,he ight=
540,width=500,r esizable=yes,le ft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");
win2.focus();
}
</script>

Need help. Thanks
May 26 '07 #1
3 4722
simora wrote:
Hi:
Need some working sample code to post hidden form data from a php page
to a new popup window. 540 x 500 centered. The popup that I'm calling
already is formatted and has a TITLE:web-2007.php so what I need to do
is to write the values from the PHP page to that popup in specific
places.

Some of the hidden values are also like this format;

<input type="hidden" name="handling" value="<?php echo $_POST["sub"];
?>">

<input type="hidden" name="email" value="<?php echo $_POST["email"];
?>">

Right now,the hidden input fields are on a PHP page, and I'm calling the
popup from the generated PHP page like so:

<A HREF="javascrip t:void(0);" style="TEXT-DECORATION: none"
onClick="popUpC enteredWindow() ;">&nbsp;<sp an style="color: blue; font-
family: Verdana;">&nbsp ;Click Here &nbsp;&nbsp; </span></span></A></font>

<script language="JavaS cript">

function popUpCenteredWi ndow() {
var iMyWidth;
var iMyHeight;
//gets top and left positions .
iMyWidth = (window.screen. width/2) - (200 + 10);
//half the screen width etc..
iMyHeight = (window.screen. height/2) - (255 + 1);
//half the screen height etc...
var win2 = window.open("we b-2007.php","Wind ow2","status,he ight=
540,width=500,r esizable=yes,le ft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");
win2.focus();
}
</script>

Need help. Thanks
Hi,

This can be solved in different ways, depending on your needs/setup.
1) The easiest way is changing the url you use and expand it so it contains
(urlencoded) name/value pairs.
eg:

var theURL = "web-2007.php";
// get some hidden form info:
var firstname = document.forms. formnamehere.fi rstname.value;
theURL += "?firstname="+f irstname;
theURL = encodeURI(theUR L);

var win2 = window.open(the URL,"Window2"," status,height=
540,width=500,r esizable=yes,le ft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");

Then from the popup, read the URL, and get your name-value pairs out.

2) More complex: Make window-communication.
EG: On the popupwindow add an onLoad-eventhandler that calls a function that
loads info from the opener.
eg:
<body onLoad="loadHid denInfo();">
....
<script type="text/javascript">
function loadHiddenInfo( ){
var firstname = opener.document .forms.formname here.firstname. value;
alert (firstname);
}
</script>

3) Use a SUBMIT instead of a hyperlink. CHange the target of your form to
the name of the window you opened (it must be opened first by yourself if
you want to set dimension like width and height.).

Regards,
Erwin Moller
May 26 '07 #2
ma


Hi:

Thanks for the ideas, but I'm not well versed on the level of javascript
required. I'll need more sample code suited to my situation. On my
formatted PHP page, I'm set up to get vlues in this format;
<?php echo $_POST["salutation "]; ?>.&nbsp;
<?php echo $_POST["first_name "]; ?>&nbsp;<?php echo $_POST["last_name"];
?><BR>
&nbsp;<?php echo $_POST["address"]; ?><BR>

What I need to see is both how I can send the hidden values, and how do
I display them on the PHP popup page. I do not need an alert.

Is there some way to make sure that the popup is fully opened before I
start having it get the hidden values.?

=============== =============== ===============

On Sat, 26 May 2007 03:14:38 -0700, Erwin Moller
<si************ *************** *************** @spamyourself.c omwrote:
simora wrote:
>Hi:
Need some working sample code to post hidden form data from a php page
to a new popup window. 540 x 500 centered. The popup that I'm calling
already is formatted and has a TITLE:web-2007.php so what I need to do
is to write the values from the PHP page to that popup in specific
places.

Some of the hidden values are also like this format;

<input type="hidden" name="handling" value="<?php echo $_POST["sub"];
?>">

<input type="hidden" name="email" value="<?php echo $_POST["email"];
?>">

Right now,the hidden input fields are on a PHP page, and I'm calling the
popup from the generated PHP page like so:

<A HREF="javascrip t:void(0);" style="TEXT-DECORATION: none"
onClick="popUp CenteredWindow( );">&nbsp;<sp an style="color: blue; font-
family: Verdana;">&nbsp ;Click Here &nbsp;&nbsp; </span></span></A></font>

<script language="JavaS cript">

function popUpCenteredWi ndow() {
var iMyWidth;
var iMyHeight;
//gets top and left positions .
iMyWidth = (window.screen. width/2) - (200 + 10);
//half the screen width etc..
iMyHeight = (window.screen. height/2) - (255 + 1);
//half the screen height etc...
var win2 = window.open("we b-2007.php","Wind ow2","status,he ight=
540,width=500, resizable=yes,l eft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");
win2.focus() ;
}
</script>

Need help. Thanks

Hi,

This can be solved in different ways, depending on your needs/setup.
1) The easiest way is changing the url you use and expand it so it
contains
(urlencoded) name/value pairs.
eg:

var theURL = "web-2007.php";
// get some hidden form info:
var firstname = document.forms. formnamehere.fi rstname.value;
theURL += "?firstname="+f irstname;
theURL = encodeURI(theUR L);

var win2 = window.open(the URL,"Window2"," status,height=
540,width=500,r esizable=yes,le ft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");

Then from the popup, read the URL, and get your name-value pairs out.

2) More complex: Make window-communication.
EG: On the popupwindow add an onLoad-eventhandler that calls a function
that
loads info from the opener.
eg:
<body onLoad="loadHid denInfo();">
...
<script type="text/javascript">
function loadHiddenInfo( ){
var firstname = opener.document .forms.formname here.firstname. value;
alert (firstname);
}
</script>

3) Use a SUBMIT instead of a hyperlink. CHange the target of your formto
the name of the window you opened (it must be opened first by yourselfif
you want to set dimension like width and height.).

Regards,
Erwin Moller


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
May 26 '07 #3
ma <al.qwest.netwr ote:
>

Hi:

Thanks for the ideas, but I'm not well versed on the level of javascript
required. I'll need more sample code suited to my situation. On my
formatted PHP page, I'm set up to get vlues in this format;
<?php echo $_POST["salutation "]; ?>.&nbsp;
<?php echo $_POST["first_name "]; ?>&nbsp;<?php echo $_POST["last_name"];
?><BR>
&nbsp;<?php echo $_POST["address"]; ?><BR>

What I need to see is both how I can send the hidden values, and how do
I display them on the PHP popup page. I do not need an alert.

Is there some way to make sure that the popup is fully opened before I
start having it get the hidden values.?
Hi,

I don't want to be rude: but I adressed those questions.
If you are not able to implement them, what do you want us to do?
Create the whole script without being able to see what you made already?

My suggestion: OR you learn a little JavaScript basics so you can implement
it yourself (it is really easy), OR you hire somebody who can help you with
it.
Sorry mate.

Regards,
Erwin Moller
>
=============== =============== ===============

On Sat, 26 May 2007 03:14:38 -0700, Erwin Moller
<si************ *************** *************** @spamyourself.c omwrote:
>simora wrote:
>>Hi:
Need some working sample code to post hidden form data from a php page
to a new popup window. 540 x 500 centered. The popup that I'm calling
already is formatted and has a TITLE:web-2007.php so what I need to do
is to write the values from the PHP page to that popup in specific
places.

Some of the hidden values are also like this format;

<input type="hidden" name="handling" value="<?php echo $_POST["sub"];
?>">

<input type="hidden" name="email" value="<?php echo $_POST["email"];
?>">

Right now,the hidden input fields are on a PHP page, and I'm calling the
popup from the generated PHP page like so:

<A HREF="javascrip t:void(0);" style="TEXT-DECORATION: none"
onClick="popU pCenteredWindow ();">&nbsp;<spa n style="color: blue; font-
family: Verdana;">&nbsp ;Click Here &nbsp;&nbsp; </span></span></A></font>

<script language="JavaS cript">

function popUpCenteredWi ndow() {
var iMyWidth;
var iMyHeight;
//gets top and left positions .
iMyWidth = (window.screen. width/2) - (200 + 10);
//half the screen width etc..
iMyHeight = (window.screen. height/2) - (255 + 1);
//half the screen height etc...
var win2 = window.open("we b-2007.php","Wind ow2","status,he ight=
540,width=500 ,resizable=yes, left=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");
win2.focus( );
}
</script>

Need help. Thanks

Hi,

This can be solved in different ways, depending on your needs/setup.
1) The easiest way is changing the url you use and expand it so it
contains
(urlencoded) name/value pairs.
eg:

var theURL = "web-2007.php";
// get some hidden form info:
var firstname = document.forms. formnamehere.fi rstname.value;
theURL += "?firstname="+f irstname;
theURL = encodeURI(theUR L);

var win2 = window.open(the URL,"Window2"," status,height=
540,width=500,r esizable=yes,le ft=" + iMyWidth + ",top=" + iMyHeight +
",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=ye s");

Then from the popup, read the URL, and get your name-value pairs out.

2) More complex: Make window-communication.
EG: On the popupwindow add an onLoad-eventhandler that calls a function
that
loads info from the opener.
eg:
<body onLoad="loadHid denInfo();">
...
<script type="text/javascript">
function loadHiddenInfo( ){
var firstname = opener.document .forms.formname here.firstname. value;
alert (firstname);
}
</script>

3) Use a SUBMIT instead of a hyperlink. CHange the target of your form to
the name of the window you opened (it must be opened first by yourself if
you want to set dimension like width and height.).

Regards,
Erwin Moller


May 28 '07 #4

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

Similar topics

2
14104
by: Johan | last post by:
I have a form that submit to the same page when double click on a product: <form method="post" action="quotes.asp" name="form1" onDblClick="javascript:formHandler()"> How can I submit the form in a popup window and another page using a html link? Following code doesn't work because of the nested apostrophes in the javascript.
6
8820
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?) that could cause problems if I try to post a form at www.mydomain.com to www.anotherdomain.com?
2
1952
by: aaa | last post by:
I am bringing up a popup which has a couple of fields that the user enters. I fill the hidden fields then submit and close the popup which then reverts back to my main form, which retrieves the hidden vars and does the database operation. Seems straight forward enough but I have run into a few stumbling blocks including submitting then closing the popup and reverting control back to the main form to pick up the variables. Someone has to...
1
2584
by: jeffrobbins | last post by:
Hello, I am having an issue that I haven't been able to find an answer for. Any help or pointers to information would be appreciated. I have a form, lets call it mainForm, that contains a dropdownlist of offices that is populated from a database query, and other form elements. A second form, lets call it childForm, can be opened (window.open()) via a link off of mainForm to add another office to the database. What I would like is to be...
2
2211
by: Bill Steele | last post by:
I want to have a window pop up with a form. When the form is submitted, it needs to pass along the URL of the original window. If find on th web eight gazillion descriptions of how to pass data from one page to another via hidden fields, but not a word about how to pass that data a second time. I find that <SCRIPT LANGUAGE="JavaScript"><!-- document.write(document.referrer);
1
3590
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1- <SCRIPT TYPE="text/javascript"> function popupform(myform, windowname)
2
2529
by: Bam | last post by:
Hey gang. I have searched the web, and can't find what i need. hoping someone here can help i have a form that pops up based on a click. the popup opens up correctly. now what i want it to do is this. 1. submit the data to an asp page. that part i got working 2. close the popup box. have that working as well. 3. after processing the data on the asp page, direct to and refresh the parent page that the popup was created from.
11
5319
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. How do I submit that form1 from the javascript from my current window? Thanks.
11
3103
by: viki1967 | last post by:
Hidden field Hello my friends. This is a htm page that contains a form open in window popUp ( page daughter ). This form insert a value in the one hidden field called "tec", in other form open in the page mother. As you can see the select contains multiple attribute.
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9334
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
9259
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
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
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...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
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
4569
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
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.