473,761 Members | 8,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form HTML Submit in popup

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="jav ascript:formHan dler()">
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.

<a href="#"
onclick="window .open('javascri pt:document.for m1.action='save quote.asp';
document.form1. submit();','pop up','width=150, height=100,top= ' + topPos +
',left=' + leftPos);">Save Quote</a>

<script language="JavaS cript">
var w = 400, h = 200;
if (document.all || document.layers ) {
w = screen.availWid th;
h = screen.availHei ght;
}
var popW = 200, popH = 150;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;
</script>
Jul 23 '05 #1
2 14104
> How can I submit the form in a popup window and another page using a html
link?


You need to define the form in the following manner (note the target):

<form action="savequo te.asp" target="popup" name="quote">
... form data ..
</form>

The link like this

<A HREF="javascrip t:saveQuote();" >Save Quote</A>

And some script code

<SCRIPT LANGUAGE="JavaS cript">

function saveQuote() {

// first open window with right target
popup = window.open("ab out:blank", "popup", "etc..");

// then submit form into this window
document.quote. submit();
}
</SCRIPT>

That should work.

Jul 23 '05 #2
Vincent van Beveren wrote:
> How can I submit the form in a popup window and another page using a html
> link?


You need to define the form in the following manner (note the target):

<form action="savequo te.asp" target="popup" name="quote">
... form data ..
</form>

The link like this

<A HREF="javascrip t:saveQuote();" >Save Quote</A>


And then read this:
http://www.jibbering.com/faq/#FAQ4_24
And some script code

<SCRIPT LANGUAGE="JavaS cript">
<script type="text/javascript">
function saveQuote() {

// first open window with right target
popup = window.open("ab out:blank", "popup", "etc..");

// then submit form into this window
document.quote. submit();
document.forms['quote'].submit();
}
</SCRIPT>

That should work.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #3

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

Similar topics

2
5551
by: Matt | last post by:
Can form.submit() submit another form? In the following example, in page1.asp, it is fine to submit the current form: form1.submit(), and and I could see the value "Joe" in page2.asp. However, if I do: form3.submit(), then it couldn't go to page2.asp. Any ideas?? Thanks!! //page1.asp <html> <head> </head> <body onload="form1.submit()"> //OK!
1
1991
by: Terence Parker | last post by:
I have a form which enables users to type in some text in a <TEXTAREA>, allowing them to use HTML. I have defined two submit buttons - one to submit as usual, but one which I would like to popup another window and submit the typed text to different action/script to give a preview. So far I have done this (removing the excess formatting HTML for clarity): ---------- <SCRIPT language="JavaScript" type="text/javascript"> function...
2
2073
by: tao lin | last post by:
Hi, all I am using VS2003 under WinXP. My WebApp has a WebForm which has a html form has some search condition textbox, once the user fill in the condition and click submit button. My app will stay in the same WebForm but open a popup window in the browser to show the search results. So I implement like this: private void btnSubmit_Click(object sender, System.EventArgs e)
4
8165
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page via window.open 3. myFunction() submits the main page's form via document.form.submit() 5. User closes popup window and clicks browser's Back button to return to form entry page 6. All the form data that the user had filled out is now blank...
3
8011
by: kirke | last post by:
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)
1
1785
by: morangi | last post by:
<?php session_start(); error_reporting(E_ERROR && ~E_NOTICE && ~E_WARNING); ob_start(); $link = mysql_connect('localhost', 'root', 'test'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (isset($_POST))
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
5320
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.
0
9554
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
9376
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
10136
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
9811
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
8813
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
7358
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
6640
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();...
1
3911
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
3509
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.