473,698 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form-pop up

In php, is there any way to submit button(in a form) makes window
pop-up?

-INDEX.PHP :

<form id="form1" name="form1" method="post" action="vehicle .php">
<input name="submit" type="submit" id="submit" value="submit" />
</form>

This goes to only action page. (vehicle.php)
I wanna pop-up the page(vehicle.ph p) and use data from index page.
Also when i close the pop up page, I wanna use data in index what was
selected in pop-up page(vehicle.ph p)

Is it possible? Thx!

Oct 11 '06 #1
3 8004
kirke wrote:
In php, is there any way to submit button(in a form) makes window
pop-up?

-INDEX.PHP :

<form id="form1" name="form1" method="post" action="vehicle .php">
<input name="submit" type="submit" id="submit" value="submit" />
</form>

This goes to only action page. (vehicle.php)
I wanna pop-up the page(vehicle.ph p) and use data from index page.
Also when i close the pop up page, I wanna use data in index what was
selected in pop-up page(vehicle.ph p)

Is it possible? Thx!
Hi,

This has little to do with PHP. It is just a HTML thing.
Just add a target to your form and it will pop-up in a new window.
(If you need to address that window from javascript, use the name you just
gave it in your form.)

<form action="vehicle .php" method="POST" target="myNewWi ndow">
Regards,
Erwin Moller
Oct 11 '06 #2
wow! thx! that's exactly what i want!

can i do one more question?

Thus, i can pop-up the window.
and there's also drop-down box. and we need submit button.
However, when i click the submit button (in pop-up window), i want to
close it and its action page is index.php(previ ous page)
which commend is needed to do this?
Thx! again!

Erwin Moller wrote:
kirke wrote:
In php, is there any way to submit button(in a form) makes window
pop-up?

-INDEX.PHP :

<form id="form1" name="form1" method="post" action="vehicle .php">
<input name="submit" type="submit" id="submit" value="submit" />
</form>

This goes to only action page. (vehicle.php)
I wanna pop-up the page(vehicle.ph p) and use data from index page.
Also when i close the pop up page, I wanna use data in index what was
selected in pop-up page(vehicle.ph p)

Is it possible? Thx!

Hi,

This has little to do with PHP. It is just a HTML thing.
Just add a target to your form and it will pop-up in a new window.
(If you need to address that window from javascript, use the name you just
gave it in your form.)

<form action="vehicle .php" method="POST" target="myNewWi ndow">
Regards,
Erwin Moller
Oct 11 '06 #3
kirke wrote:
wow! thx! that's exactly what i want!
good. :-)
Glad to be of help.
can i do one more question?
sure.
>
Thus, i can pop-up the window.
and there's also drop-down box. and we need submit button.
However, when i click the submit button (in pop-up window), i want to
close it and its action page is index.php(previ ous page)
which commend is needed to do this?
Thx! again!
The easiest way to do this is by making the target of the form in the popup
a new script that:
1) processes your posting. (DB-update or something)
So you do NOT let your original page do the processing.
2) will only output this:

<?
// process your posting of the dropdown

?>
<html>
<head>
<script type="text/javascript">
// optionally refresh the original page
opener.location .reload(true);

// close this popupwindow
self.close();
</script>
</head>
</html>
But this might get you into trouble because javascript is now closing a
window that is NOT created by JavaScript.
Some browsers will ask the user for permission to close the window, which is
an annoyance in your case. Test it.

You can solve this by letting Javascript open the popup in the first place.
If JavaScript opened the page, the browser will let JavaScript close it
without a warning.

This has little to do with PHP, but I'll give you an example. If you need
more, just go to the right place: comp.lang.javas cript

How to let Javascript open a new window?

1) Replace your submitbutton with something like this:
<input type="button" value="makepopu p" onClick="doPopu p();">

and add a function somewhere on your first page:
<script type="text/javascript">
funtion doPopup(){
// make a new window with the name MyNewWindow
var myPopup = window.open("bl ank.html","MyNe wWindow");

// Post the form
document.forms["yourformnamehe re"].submit();

}
</script>

You'll have to provide an empty page named blank.html.
Also name your form by adding name="bla", and use that name in the
documnt.forms["bla"].submit();

Warning1: I didn't test this, but the idea works.
Warning2: This will completely fail if the visitor has no Javascript
enabled.
If this is the case, then you cannot close a popup window, no matter what.

Regards,
Erwin Moller

Oct 11 '06 #4

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

Similar topics

3
5648
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change to the appropriate mode and test the html form it gave me an 500 internel server error. I really need it to be done soon, I would not post here before I test it as much as I can,
5
6085
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
4
2124
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the same amount of Line Items. If I have all 20 Line Items, it works great. var sub1 = form.Line_Item_Subtotal1.value var sub2 = form.Line_Item_Subtotal2.value var sub3 = form.Line_Item_Subtotal3.value var sub4 = form.Line_Item_Subtotal4.value
19
3606
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the thing you know ;-) After discovering that access 2000 support form properties (I'm a
5
73209
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
3
2335
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
5
10903
by: Miro | last post by:
I will try my best to ask this question correctly. I think in the end the code will make more sence of what I am trying to accomplish. I am just not sure of what to search for on the net. I have a form that has a button. ( this form is a child form of a parent form ( main form ). Anway...in this child form I have a button, and if clicked a bunch of code will get executed. I would like to show a Progress Bar / form in modal/ShowDialog...
8
36128
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query button on it. If the query returns multiple results, a new window is opened with a grid containing the results. When the user double clicks on the desired row in the grid, I want the first form to populate with the correct data. I don't know how...
5
2301
by: simononestop | last post by:
Hi im totally new to perl this is my first go at using it (I normally use asp). I have set up a form with a cgi script from demon hosting. I have edited the script and the form works it sends me an email. however all the information is missing form the email I only get the first form text field?? #!/bin/perl # ------------------------------------------------------------
6
2270
by: Thom Little | last post by:
Using C# 3.5 I have a form that calls many other sub-forms. Typically there will be five forms open at the same time. If the main form is closed all the sub forms are also closed. Is there a standard way to gain control within the sub-forms to do individual clean-up prior to their removal?
0
8673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8601
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
9156
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
9021
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...
0
7716
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
5860
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
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3043
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
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.