473,390 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

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="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.

<a href="#"
onclick="window.open('javascript:document.form1.ac tion='savequote.asp';
document.form1.submit();','popup','width=150, height=100,top=' + topPos +
',left=' + leftPos);">Save Quote</a>

<script language="JavaScript">
var w = 400, h = 200;
if (document.all || document.layers) {
w = screen.availWidth;
h = screen.availHeight;
}
var popW = 200, popH = 150;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;
</script>
Jul 23 '05 #1
2 14078
> 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="savequote.asp" target="popup" name="quote">
... form data ..
</form>

The link like this

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

And some script code

<SCRIPT LANGUAGE="JavaScript">

function saveQuote() {

// first open window with right target
popup = window.open("about: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="savequote.asp" target="popup" name="quote">
... form data ..
</form>

The link like this

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


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

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

// first open window with right target
popup = window.open("about: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.javascript 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
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...
1
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...
2
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...
4
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...
3
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"...
1
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: ' ....
2
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...
11
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. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.