Popup to avoid losing unsaved data

Hi,
I'm developing a BSP where the user will modify data and I'd like a popup to appear when the 'Back' button is pressed and there have been usaved modifications.
Basically it should be a popup with a 'You have modified the data. Are you sure you want to leave the page without saving?' or something like that and two buttons YES/NO (the yes button should execute an event and the no just close the popup).
Can you help me with it?
Many thanks in advance
Carles

Hi,
Are you talking about the Browser back button ?
If yes, then i have a solution for Internet Explorer...
Try this :
<html>
<script language = "javascript">
window.onbeforeunload = bunload;
function bunload(){
  mess = "You will lose all information providednduring navigation of this site";
  return mess;
function confirmEvent()
     alert("Function called");
     if(!confirm('Do you really want to proceed?'))
          window.onbeforeunload = false
          return false;
function test()
alert("Hellio");
document.frm.t1[2].style.background = "rgb(231,220,24)";
var arr = document.frm.elements;
var i;
for(i=0;i<arr.length;i++)
     if(arr<i>.type == "text")
          if(!arr<i>.disabled)
               alert(arr<i>.value);
alert(document.frm.t1[3].value);
</script>
<body>
<form name="frm">
<input type="text" name="t1" size=5 value="Hello1" disabled="true">
<input type="text" name="t1" size=5 value="Hello2" style="font-family: Verdana;font-size: 10; align=middle; height: 17px;border: solid rgb(220,225,260) 1px">
<input type="text" name="t1" size=5 value="Hello3">
<input type="button" name="b1" value="Click here" onClick="test()">
</form>
</body>
</html>

Similar Messages

  • My computer crashed.    How do I sync with a new computer without losing unsaved data?

    My computer crashed.    How do I sync with a new computer without losing unsaved data?

    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    For items you cannot get the above way use a third-party utility such as Phone to PC

  • Avoid losing game data

    Here's the background: my laptop crashed so I restored it to factory settings (wiping all data from the hard drive). Ironically, before doing this, I had access to my hard drive and made copies of all documents, videos, photos, etcetera that I wanted but didn't back up anything from iTunes because I didn't think I'd need to.
    Anyway, I re-installed iTunes and authorized the laptop for my account and found out that trying to sync anything would erase all of the data on my 64GB iTouch. I transferred purchases but that only saved some movies as most of my music was ripped from CDs. I looked around on the Internet and downloaded SharePod so I have my music back (although that wasn't that important because I can just rip the CDs again).
    Now, my question: What can I do to save my apps WITHOUT losing any game data? Please!
    That's the most important thing (it really makes you feel bad when you think three months of building your Tiny Tower might have been wasted ). Seriously though, surely someone must have come up with something.
    Note: my iPod is NOT jailbroken and I do NOT want to jailbreak it.

    - You can to this:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    - Backup the i{Pod by:
    iOS: How to back up
    - Restore the iPod from backup by the instructions included here:
    iOS: How to back up
    Note the the backup that iTunes makes does not included synced synced media like apps and music

  • How to call a macro(check for unsaved data) before calling refresh button of EPM TAB

    Hi,
    I want to show a popup message for any unsaved data before USER hit the refresh button on EPM tab.
    I write the macro like as below in module
    Function TestForUnsavedChanges()
        If ActiveWorkbook.Saved = False Then
            If MsgBox("There is unsaved data, save the data otherwise u will loose the data. Do You Want to Save the Data ?", vbYesNo, "Warning") = vbYes Then
            bSave = True
            Else
            bSave = False
            Application.Undo
            End If
        End If
    End Function
    so how to execute this macro before Refresh ?
    Thanking in Advance !!

    Hi Nilesh,
    Try to add this macro under Function BEFORE_REFRESH.
    Hope this helps.
    Regards,
    Astha

  • My desktop pc has died and I have not backup up I tunes for months. If I install I tunes onto my laptop is there a way I can avoid losing all my data since my last backup?

    My desktop pc has died and I have not backup up I tunes for months. If I install I tunes onto my laptop is there a way I can avoid losing all my data since my last backup?

    You should be able to:
    Backup the device to the new windows installation
    Transfer your purchases into a newly authorized library
    Recover any other media using third party tools as suggested in this post from forum regular Zevoneer
    Restore the device from the backup
    This process should switch the association of the device to the new library, preserving the data and settings in your apps.
    When you get it all fixed, make a backup!
    tt2

  • How to avoid losing data when communicat​e with high speed motor?

    I connect with high speed servo motor via RS232. To avoid losing data. i thought to set receive buffer, only read the buffer if it collected all bytes. Is this possible?

    Hi,
    If you know the number of bytes you are trying to read, you can set a viRead call to return information once the particular number of bytes have been read.  For more information on this, take a look at the KnowledgeBase article on a Serial VISA Read to read a requested number of bytes. 
    Even if you read before all bytes have been collected, you should not lose data.  When the specified number of bytes are stored in the buffer, the viRead call will send the information to the program, and new data coming in will be stored in the buffer until the byte count is reached again.
    I hope this helps,
    Lauren L.
    Applications Engineering
    National Instruments

  • HT4137 Will doing this erase old text messages?  If so, is there any way to avoid losing them?

    I just looked read iOS: How to back up your data and set up as a new device.  I've been having a few bugs, but do not want to lose my old text messages.  Will setting up as a new device and then syncing erase old text messages?  If so, is there any way to avoid losing them?

    You will not lose text message, if you back up your phone correctly and then restore from that backup.  If your going to restore your phone as new and not from backup, then your text will not be there until you decide to restore from that backup.
    If you don't want to lose the message, take a look in the app store to see if you can transfer to your computer.

  • How to enable workprotect mode for unsaved data

    Hi,
    I am trying to enable workprotect mode for unsaved data and the reason is after entering hours in Record Working Time If the user navigates to other screen ,all the data entered in time is getting lost.
    For enabling the Workprotect mode I did the following things
    1.Go to system admin -> system config ->service config->Applicaitons ->com.sap.portal.epcf.loader
    Change workprotect.mode.default to 2
    Restart the config by right clicking on com.sap.portal.epcf.loader . Click Administrate ->restart
    and
    2.Opened the Personalise option from Masthead and selected workprotect mode and selected
    Choose action in popup on unsaved data
    But still it doesn't work.
    What is missing here
    Thanks
    Bala Duvvuri

    GLM,
    I am testing with my own user id and i have set the settings as mentioned above
    Thanks
    Bala Duvvuri

  • Confirm Dialog on Closing Web Application with unsaved data?

    Hi all,
    I am searching for best-practices or official solutions for implementing the following functionalty:
    User is trying to close the browser window or tab (Mozilla Firefox) by hitting the "X". We need to ask him if he is sure cause there might be unsaved data.
    The only solution we now see is the following:
    - event "onbeforeunlad":
    window.onbeforeunload = function (oEvent) {
      oEvent.returnValue = 'Sure? Unchanged data might be lost'
    Problem is that this event also runs, when youre navigating in the analysis item, e.g. expanding a hierarchy. You have to switch it of for every single Item with onmouseover and switch it on again later.
    And further on: It still has to be bound to the data... if data hasn't changed, it shouldnt pop up.
    Question: Are there any official suggestions from SAP? Seems to be a standard requirement. If not, do you know any better solutions for implementing this functionality?
    Thanks in advance for your help,
    Michael

    try capturing the onBeforeUnload event and display a modal confirmation dialog asking the user if he really wants to navigate away from the page; and warning him that if he does so, all the changes he made hitherto will be gone.
    However, you need to handle this intelligently since you need to identify if any fields in the form have changed and only then warn the user to confirm his decision to go away from this page.
    You can do this by having a flag which is initialized to false but when onBeforeUnload event is fired, you would check if any of the form fields in the page have changed by iterating over each and every form field,and then setting the flag to true if some thing changed
    the onBeforeUnload Handler will always return this flag, if it is true, you will get this confirmation popup, else the page will go away. To show a customized confirmation dialog, perhaps you would have to invoke the custom dialog call from with in the onBeforeUnload handler. When the user says yes, return false;else true.

  • Can I use two different devices with different apple ID for backing up data on one machine without losing any data that was backed up with one device earlier?

    Can I use two different devices with different apple ID for backing up data on one machine without losing any data that was backed up with one device earlier?

    The link is to a discussion started on 12/18 in the FiOS Internet forum.  Here's the link I get now, however it is different than the link I pulled a few hours ago.  If this system changes the link again, it may not work.
    http://forums.verizon.com/t5/FiOS-Internet/Frustration-and-just-confused-with-internet-help-please/t...
    You can also look for the topic, "frustration and just confused" in the FiOS Internet forum.
    Here's a link that is in the thread that gives more detail.
    https://secure.dslreports.com/faq/15984
    Good Luck!
    P.S.  "Copper Contributor" is my "rank."  gs0b is my user name.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Can I upgrade from snow leopard to mountain lion without losing my data?

    Have finished an upgrade to snow leopard without losing any data on each of 9 MacBook Pros so far.  (Have 9 more to go) Can I do the mountain lion upgrade on them without losing data or must I back up the detritus of 4 years use by teachers who despite all pleas have never backed up their documents?  Would appreciate a swift reply as everyone wants their mbp's back in their hands on Monday morning. My thanks in advance to any gurus who care to reply as my local gurus seem to have fled the ashram for the weekend.

    Installing a new version of OS X should not lead to any data loss. Of course, it's best to have a backup if anything 'goes wrong' but simply isntalling the new OS shouldn't damage any data.
    Clinton

  • My iPod dispalys this message: "Connect to a computer. Use iTunes to restore."  When I connect to a computer, iTunes doesn't recognise it.  The iPod 5th Gen does not work at all. How do I fix my iPod without losing any data?

    My iPod dispalys this message:
    "Connect to a computer. Use iTunes to restore."  When I connect to a computer, iTunes doesn't recognise it.  The iPod 5th Gen does not work at all. How do I fix my iPod without losing any data?
    I have seen the Apple webpage suggesting the "five R's" (including restore).  Before doing anything, I want to be sure that restoring or any other action is not going to delete or risk my data. 
    I would be very grateful if anyone can suggest a fix for this problem, in a way that will not risk my data. 
    Thanks in advance!

    Did you try a hard reset with the iPod still connected to your PC?  Have you tried multiple USB ports, preferably high powered USB 2.0 ports?
    To do a hard reset, first make sure the hold switch is in the Off position, then press and hold both the Select (Center) and Menu buttons together long enough for the Apple logo to appear.
    Have you also worked through each and every single troubleshooting suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • I have just purchased a new ipad2 to replace my old ipad. How do i sync all the data in my apps I am worried about losing my data?

    I have just purchased a new ipad2 to replace my old ipad. How do i sync all the data in my apps I am worried about losing my data?

    iPad settings and data created and stored by a 3rd party party app along with app settings are included with the iPad's backup along with other data.
    If you are syncing your iPad direct with iTunes on your computer via USB, the iPad's backup is updated as the first step during the iTunes sync process.
    The first time you connect a new iPad or iOS device to iTunes that is used to sync with another iOS device, you are prompted to transfer the backup for the other iOS device to the new device. This is followed by a sync to transfer the same content from your computer that is on the old iPad to the new iPad such as music, movies, tv shows, 3rd party apps, photos, audio and print books, etc.

  • HT3728 My Time Capsule is working fine with ethernet connection, but it is no longer working with wifi, probably because of my wrong setting; is there a way to reset wifi setting without losing backuped data? Thanks you all

    y Time Capsule is working fine with ethernet connection, but it is no longer working with wifi, probably because of my wrong setting; is there a way to reset wifi setting without losing backuped data? Thanks you all

    Giancarlo Messalli wrote:
    1) are you sure a reset holding the reset button will not delete my data?
    Absolutely sure.. There is no connection at all.. reset is only the router side of the TC.
    For the hard disk to be erased you need to access the airport utility disk page.. request erase and confirm the operation.
    2) I can access to time capsule by ethernet but I am not able to input the corret setting by myself
    Thank you again
    I am uncertain why if you have access you cannot change settings.. but that is why you reset things so any of those problems should be fixed.
    Here is the Apple info on reset.
    http://support.apple.com/kb/ht3728
    And here is the quote from the horse's mouth so to speak.
    Factory default reset: Perform this reset if you wish to repurpose the AirPort Base Station or Time Capsule and want to remove all personal profiles and settings first. This reset resets the device to its state when you first purchased it. Data stored on internal or external hard drives connected to the device will not be erased. If you choose, you may manually erase the hard drive using AirPort Utility.

  • I got a new computer and need to sync my iPhone and iPad on it, how do i do that without losing all data.

    I got a new computer and need to sync my iPhone and ipad on it, how do i do that without losing all data. I need help ASAP!

    If you still have the old computer see: http://support.apple.com/kb/HT4527
    If you don't have your old computer, but you made regular backups of it, restore the most recent backup using the backup software that you used to make the backup. You will have to read the instructions for it.
    If you don't have your old computer and you did not back it up regularly see: Syncing to a "New" Computer or replacing a "crashed" Hard Drive

Maybe you are looking for

  • How to link documents in SD following tables?

    Hi All, I am new to SD and I am a technical person not a business person. But now I have to find out how to link a billing document of type Credit Memo (tcode VF03) with the invoice that originated it. I can see in the document flow of the credit mem

  • After updating to ios 7.0.3 video is not working

    I have ipad 2, and I updated to IOS 7.0.3 yesterday. Today I realized video downloaded to ipad is not loading. Do you know why and how to fix this?

  • 10.1.2 Backward Compatibility in 10.1.3?

    I want to upgrade my development BPEL/JDeveloper install to 10.1.3, but I still need to support our BPEL applications running on 10.1.2. I know when I install BPEL's development system 10.1.3 it will replace the 10.1.2 installation. The question is:

  • Ios8 not receiving messages from a member of a group message

    I have a recurring group message with some of my friends. When I updated to iOS8 I stopped receiving messages from one of the members of the group, but everyone else is still receiving them. When I text just that group member though, I receive her me

  • How to create several procedures from several script files?

    Hello, I have several procedures for SAP HANA. Every procedure is stored in a script file. I can only use SAP HANA Studio.  How can I easily  run all script files to create all procedures on a schema? Can somebody help me? Best regards, Y.Hu