This topic is locked

How to ask user for confirmation if he wants to return to list

3/24/2011 10:30:43 AM
PHPRunner General questions
J
jacekq author

Hello,
On Edit and Add pages we have 'return to list' button. How to ask user, when he click the button, if he is sure to come back to list?

Sometimes, user clicks the button accidentialy and loses his work...

The same situation is with 'next' and 'previous' record on Edit page.
How to prevent?
Regards,

Jacek

F
FunkDaddy 3/25/2011

Jacek,
You posted your question under the "tips & tricks" section of the forums... you should post in the "general questions" area instead, otherwise fewer users will actually be able to see your question.
To help you out you look at the code I included a right here in this same section: http://www.asprunner.com/forums/topic/16666-confirm-dialog-box-before-saving-form/ You should be able to easily adapt the code to suit your needs using the similar javascript logic.
Cheers,

Sergey Kornilov admin 3/25/2011

Marcelo is right on money with this one.
I just want to add that Next/Prev buttons on the Edit page become disabled once you changed the content of one of fields.

J
jacekq author 3/26/2011

Hi Marcelo,



To help you out you look at the code I included a right here in this same section: http://www.asprunner.com/forums/topic/16666-confirm-dialog-box-before-saving-form/ You should be able to easily adapt the code to suit your needs using the similar javascript logic.
Cheers,


In my opinion pressing 'Save button' is a little bit different than pressing 'Return to list' or Pev/Next buttons. When you click ''Return' reset event is generated so I can display warning message for user to confirm leaving the Edit form without saving but I can't stop a user when he choose cancel - I don't know how to return to editing the form...
Regards,

Jacek

E
eddyzzz 4/9/2011



Hi Marcelo,
In my opinion pressing 'Save button' is a little bit different than pressing 'Return to list' or Pev/Next buttons. When you click ''Return' reset event is generated so I can display warning message for user to confirm leaving the Edit form without saving but I can't stop a user when he choose cancel - I don't know how to return to editing the form...
Regards,

Jacek

E
eddyzzz 4/9/2011



I'm also very interested in an general solution to this
When somebody leaves the (inline)edit by clicking the "show all" button or another( search) button and forgets to SAVE the records, it would be great to have a warning message like "You did not yet save you data, are you sure you want to continue?"
Edwin