Recognising Browser refresh event and preventing to call save action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pingalkar
    New Member
    • Feb 2007
    • 6

    Recognising Browser refresh event and preventing to call save action

    In my application, on one form i m getting information from user and save this information , after saving this information again we loading that page. (At this moment if any one try to refresh this page, then save action will call) this should not be happen. only data will save , when we click on the save button.
    Why every refresh save action getting call and what is solution on this problem?
    Is there any javascript method available to recognise browser refresh event and preventing to call this save action.
    Pls help me.

    -Gaj
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    you need to check if the data for that particular user is already saved.

    Comment

    • dmjpro
      Top Contributor
      • Jan 2007
      • 2476

      #3
      try ...

      window.onbefore unload = event_handler_r ef

      Comment

      Working...