Loading ...
Sorry, an error occurred while loading the content.

Alerts for pending changes and re-submission

Expand Messages
  • Shekar C. Reddy
    Manuel, Is there a way to display an alert if the user makes changes to the form and then tries to: 1. Navigate away from the page 2. Refresh the page 3. Close
    Message 1 of 2 , May 29 7:34 AM
    • 0 Attachment
      Manuel,

      Is there a way to display an alert if the user makes changes to the
      form and then tries to:

      1. Navigate away from the page
      2. Refresh the page
      3. Close the browser

      without saving the changes? Something like:

      ------------------------------------------------------
      Are you sure you want to navigate away from this page?

      The changes you made will be lost if you navigate away from this
      page.

      Press OK to continue, or Cancel to stay on the current page.

      [OK] [Cancel]
      ------------------------------------------------------

      The above message may be made configurable similar to
      ResubmitConfirmMessage but the two buttons (Ok/Cancel) are
      desirable. Most users would profusely thank the developers (myself,
      yourself... Ok! Our users may not know you but WE will thank you!)
      for offering such a friendly/intelligent feature. Most of our forms
      have over 50 fields and a wrong key-press/mouse-click could render
      the users lose their changes - freaking them out!!


      2. Further, how could I extend the Output() method to display:

      "Form processing in progress! Please wait..."
      [OK]

      with just one button (OK) instead of giving an option to resubmit
      the form with two buttons? Or disable the clicked button (and
      preferably all other buttons on the form) on-submit?

      Regards,
    • Manuel Lemos
      Hello, ... You need to check that with the onunload body page tag. ... I don t think you can cancel unloading a page. Never tried though. ... See the
      Message 2 of 2 , Jun 7, 2006
      • 0 Attachment
        Hello,

        on 05/29/2006 11:34 AM Shekar C. Reddy said the following:
        > Manuel,
        >
        > Is there a way to display an alert if the user makes changes to the
        > form and then tries to:
        >
        > 1. Navigate away from the page
        > 2. Refresh the page
        > 3. Close the browser
        >
        > without saving the changes? Something like:

        You need to check that with the onunload body page tag.


        > ------------------------------------------------------
        > Are you sure you want to navigate away from this page?
        >
        > The changes you made will be lost if you navigate away from this
        > page.
        >
        > Press OK to continue, or Cancel to stay on the current page.
        >
        > [OK] [Cancel]
        > ------------------------------------------------------

        I don't think you can cancel unloading a page. Never tried though.


        > 2. Further, how could I extend the Output() method to display:
        >
        > "Form processing in progress! Please wait..."
        > [OK]
        >
        > with just one button (OK) instead of giving an option to resubmit
        > the form with two buttons? Or disable the clicked button (and
        > preferably all other buttons on the form) on-submit?

        See the test_ajax_form.php example.

        --

        Regards,
        Manuel Lemos

        Metastorage - Data object relational mapping layer generator
        http://www.metastorage.net/

        PHP Classes - Free ready to use OOP components written in PHP
        http://www.phpclasses.org/
      Your message has been successfully submitted and would be delivered to recipients shortly.