473,394 Members | 1,811 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,394 software developers and data experts.

JavaScript pop up close on submit

We had a developed add a pop up on our site, and I am trying to get it to close once submit is pressed... I have searched around and tried many things but nothing seems to work. I am not too familiar with JavaScript was wondering if anyone has any suggestions...

below is the main part of the code.

Much appreciated!


Expand|Select|Wrap|Line Numbers
  1.     <form action="/inc/usda-hardiness-zones.htm" method="post">
  2.       <input name="hitit" type="hidden" value="1" />
  3.       <tr>
  4.         <td colspan="4" align="right"><a href="javascript:MM_showHideLayers('usdazone','','hide');" onclick="document.getElementById('usdazone').style.zIndex = '-1';" class="clickclose">Click Here to Close</a><br /><br /></td>
  5.  
  6. ... blah blah blah ...
  7.  
  8. <input name="zipcode" type="text" value="<? if( isset( $zip ) ) { echo $zip; } ?>" size="5" maxlength="5" class="usdainput" />
  9.           &nbsp;&nbsp;
  10.           <input type="submit" value=" Get My USDA Zone! " onclick="javascript:submitForm(); javascript:self.close(); return false;" class="clickclose" />
Jul 11 '11 #1
1 1769
acoder
16,027 Expert Mod 8TB
Once the form is submitted, the next statement won't run. What you'll have to do is close it once the new page has loaded - use the onload event.
Jul 19 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Prometheus Research | last post by:
http://newyork.craigslist.org/eng/34043771.html We need a JavaScript component which will auto-submit a form after a set period has elapsed. The component must display a counter that dynamically...
2
by: Kenneth | last post by:
Is there anyway to create a javascript function to submit a form in the same html file?
4
by: houstoncity2004 | last post by:
Hi, I need help to JavaScript. I am new to this, and am trying to the page online ASAP. I have two submit buttons on one form, and each button will have to do different things. I named both...
4
by: Colin Graham | last post by:
Hi guys, Just a quickie here that i hope someone can help me with. Basically i want stop the user from closing the popup window using the small x button in the top right hand corner. Im aware...
8
by: shandain | last post by:
Ok, I have done this a million times, and I can't get this to work... I hope I am just being an idiot and missing something... but I can't see it... so please call me an idiot and tell me what it...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
2
by: James | last post by:
I have an ASP button on my form that will e-mail several people, and I'd like to disable it once the user clicks on it, so that they can only click on it once. I have a client side javascript...
1
by: korggrok | last post by:
OK, this makes no sense to me, perhaps someone understands what's happening. Developing a CGI app. A page contains a table with <th> header elements and <tdtable elements, both if which contain...
13
by: petcancervet | last post by:
I am writing a PHP/MySQL web-page based system on Firefox and wish to run a separate page from an <Alink to run a separate PHP script, then close that page. Firefox starts a new tab for this and it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.