Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Confirm form changes

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1735 Views
  • pmccarthy
    Avatar
    1 Post

    Confirm form changes Link to this post

    Hi All,

    I know it might be top secret information, but i have been searching for a similar script to the one you use which identifies a change to a form and gives the user the chance to save, discard or stay on page.

    Would it be possible to get a little info on how that is done. I have seen some with Javascript, but they are really naff.

    Any help would be appreicated.

    Cheers,
    Patrick in London

  • elijahlofgren
    Avatar
    Google Summer of Code Hacker
    222 Posts

    Re: Confirm form changes Link to this post

    > I know it might be top secret information, but i have been searching for a similar script to the one you use which identifies a change to a form and gives the user the chance to save, discard or stay on page.
    This dialog was removed from the gsoc branch because to was slow to load and was replaced with a Javascript confirm() dialog which simply says:

    Are you sure you want to navigate away from this page?
    WARNING: Your changes have not been saved.
    Press OK to continue, or Cancel to stay on the current page.


    From what I understand, the form change detection is accomplished by serializing the form contents and then before the page is unloaded, the current values of the form are compared to the serialized values.

    Hope this helps,

    Elijah

    1735 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.