473,765 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Obtain Button Value When OnBeforeUnload Executed

I have a script notifies the user to save their changes if they try to
close the browser or leave the current page. My problem is that if
they click on the "Save Changes" button, the script executes.
Obviously, I don't want to remind the user to save their changes when
they are trying to save their changes.

Here is the original script that I have:

window.onbefore unload = SaveChangesProm pt;
function SaveChangesProm pt() {
if ((document.Sche duleForm.txtRec ordStatus.value ) == "Changes Made;
Record Not Saved.")
{
return "YOUR CHANGES HAVE NOT BEEN SAVED.";
}
}

I tried adding the following to the IF statement, but it doesn't seem
to have any effect:
&& ((this.value) != "Save Changes")

Is what I'm trying to accomplish possible?

Thanks,
CR Junk

Jul 26 '05 #1
1 1641
I figured out a work-a-round by adding an OnClick event to my button.
With the OnClick event, I am writing out "Ignore" to a hidden input
field. I then added " && document.Schedu leForm.txtHdnIg nore.value !=
"Ignore" to my IF statement. I don't know if this is the best way to
do this, but it works.

Thanks,
CR Junk

Jul 28 '05 #2

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

Similar topics

1
1304
by: TheVisionThing | last post by:
I want to retrieve the value of the textbox 'TablePageSize' when I press the 'Go' button, like so: Page Size <input name="TablePageSize" type="text" size="4" maxlength="4" /> &nbsp;<input name="Go" type="button" value="Go" onclick="alert(document.TablePageSize.value);"/> But for various reasons I don't have a form here. How do I refer to the 'TablePageSize' object to get its value.
6
1285
by: Mike Hnatt | last post by:
I have code that will set a drop-down list value to "xyz" and the .Enabled property to False. However, when I do that I can no longer retrieve the value "xyz" upon postback. It is as if I set the .Visible property to False as well and the control wasn't rendered, but I did not. If you View Source of the rendered HTML, you can see that the control is indeed still intact (everything is the same except the disabled argument is set to...
0
2412
by: Manish | last post by:
PHP INI File Setting ------------------------------------------------------------------------------------------------------------------ error_reporting = E_ALL & ~E_NOTICE No warning message are displayed when script executed from the browser. Only Error, Fatal errors are displayed. But when the same script is executed from the command line 192.168.0.2# php lpmonitor.php Warning messages are displayed.
3
3416
by: xEM | last post by:
I have something like that: var button = document.getElementById("mybutton"); if(flag) { button.value = '&raquo;'; } else { button.value = '&laquo;'; }
3
1756
by: noddy | last post by:
I have a button <input type="button" value="Get data"> When it is clicked a database is accessed and the data is eventually displayed on the screen. While the data is being retrieved the button is displayed in its "pressed in" state. When the data arrives and is displayed the button pops out to its normal "unpressed" state.
0
1049
vanc
by: vanc | last post by:
I want to write a very simple function that will call a web page and pass the clicked button id along. The problem is I don't know how to get the button's id because I generate it programmatically!!! Below is the code that I'm sticking with <code> <input id="<%GetButtonId(); %>" type="button" value="<%=GetString()%>" onclick="window.open('OpenIt.aspx','Temp','width=1040,height=570,left=0,top=100,screenX=0,screenY=100')" /> ...
17
10351
by: govolsbaby | last post by:
Is there a way to leave the button forecolor unchanged when it is disabled? I have multiple buttons on the form and depending on various user inputs, some will or will not be enabled but I'd rather their text not go to gray. Thanks.
1
2859
by: lipton | last post by:
how can i compare a mysql table feild value with selected redio button value with php
0
9398
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
10007
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...
1
9951
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
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
8831
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
6649
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
5275
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...
1
3924
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
2805
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.