www.webdeveloper.com
Results 1 to 2 of 2

Thread: alert to user that form has chnaged and they need to save or continue without saving

  1. #1
    Join Date
    Sep 2003
    Location
    Boston
    Posts
    20

    alert to user that form has chnaged and they need to save or continue without saving

    Hi I have a frameset that has 3 frames in it. The leftframe populates the rightframe with content. In one example the rightframe has a form. If the user fills out the form and clicks save the rightframe will be reloaded, and depending on the page the leftframe reloads too. What I'm trying to accomplish is to check the form onunload if user hasnt saved the form. If they click other links with the page you get confirm message with save or continue without saving. The biggest issue I'm having is what if user fills out form doesn't click save and clicks on another frame, how do I then alert user to save and continue without reloading the frame I clicked on first?

    Any ideas or sample code would be greatly appeciated.



    P.S. I need to have this working in Cross Browser situations, not just IE

  2. #2
    Join Date
    Sep 2003
    Location
    Portsmouth, UK Occupation: Web Developer
    Posts
    2,602
    PHP Code:
    <body onunload="if(confirm('Have you saved your work?')){return true;}else{return false;}"
    Richard Turner - A Virtual Insight

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles