473,664 Members | 3,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

It's the simple things that drive me crazy... Can someone peek at this short script?

Can someone tell me why this doesn't work? I'm trying to pop a page
if someone exits a page and a checkbox is left unchecked.

// Start onUnload script//
function noBuy(){
if (agree.checked == false )
{
newwindow=windo w.open('http://www.mysite.com' ,'name','height =500,width=500, scrollbars=yes' );
if (window.focus) {newwindow.focu s()
return false;
}
else
return true;}
// End -->
Jul 20 '05 #1
1 1752
In article <86************ **************@ posting.google. com>,
ad***@lumenrese arch.com (Christopher) writes:
Can someone tell me why this doesn't work? I'm trying to pop a page
if someone exits a page and a checkbox is left unchecked.

// Start onUnload script//
function noBuy(){
if (agree.checked == false )


Try referencing the form element properly:
if (!document.form Name.checkBoxNa me.checked)

Or:

if (!document.form s["formName"].elements["checkBoxNa me"].checked)
--
Randy
All code posted is dependent upon the viewing browser
supporting the methods called, and Javascript being enabled.
Jul 20 '05 #2

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

Similar topics

20
3686
by: Thomas Heller | last post by:
I'm currently working on a new version of py2exe, which will require Python 2.3 and later, because it uses the zipimport mechanism. Since py2exe is a distutils extension, and since C compilers are commonly available on most platforms except Windows, it would be fairly easy to let py2exe generate a C source file installing this import hook, and let distutils' C compiler build an executable file from this. Would this be useful, or would...
7
2782
by: Benjamin Han | last post by:
I know I can do this by get sys.argv, tell if it's a full path, and if not, somehow join the relative path with getcwd(). Just wondering if there's a simpler way to do this. Thanks!
9
1592
by: Martin | last post by:
Due to the the large numbers of MS trained programmers unemployed we are looking at using MS Development environments. VB programmers are currently 10 a penny. However I find C a bit more logical as I come from a Clipper background. Current;y .NET seems to be the latest fashion, so what is it about and should we use it please?
2
1550
by: Garry Freemyer | last post by:
I wrote a screensaver, via Visual Studio 2003 in C# and I decided a wiser choice for me was to use an xml file to save my configs. Btw: I wonder if this is why every bit of documentation I've found for saving configuration info in an xml file speak of only doing this for web programming in fact, I get the impression that they have been slipped a mickey that made them forget that there are programs out there that are not web based, but I...
2
1640
by: Preston | last post by:
public Abc test() { if (oneStack.Count != 0) return (Abc)oneStack.Peek(); } I'd like to do return (Abc)oneStack.Peek()first, and then do receiveStack.Pop()
12
11748
by: Brett Hofer | last post by:
I must be missing something - Im a veteran C++ programmer now working with C# overall I like the language but find many weird changes... Anyway Im writing code behind an aspx. In this one C# method I am building an XML string to be insterted into a database. This string should result in: <row FIELD1="value1" FIELD2="value2" \> I am using a string type variable and I cannot get the double quotes to be added properly I have tried all of...
1
6096
lwwhite
by: lwwhite | last post by:
This is driving me crazy and probably has a simple solution. Access 2003 Win XP. On a form, I have an unbound text box named "drive." I have an unbound combo box called "version" that looks up values in a table. I have a button that calls a shell statement that concatenates the values in these fields plus some other fields and some hardcoded text to create a complete path to a document to open in in FrameMaker. This is working perfectly on...
0
1109
by: Linda Jimerson | last post by:
Hello - I created a simple Bulleted Rollover List from a Listamatic resource. When I contain this list (in a DIV with a width), IE 6.0 goes crazy (makes a mess). All other browsers act properly. I've loaded my html/css so you can see. Hope someone can help. Thanks so much. Linda at Across the Universe. http://www.acrosstheuniverse.net/bullletlist.htm
0
8437
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
8348
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
8861
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
8778
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
8636
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
4185
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
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
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
1759
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.