Warn before switching records if fields have changed?

If a user makes a change to a record and then clicks the arrow to move on to the next record, the changes are not saved. If something has changed, I’d like to at least show a warning such as, “Are you sure that you want to leave without saving changes?”

I found this old thread, but was hoping that there might be an easier solution since it was 4 years ago:
http://www.scriptcase.net/forum/showthread.php?137-Can-you-make-a-form-prompt-the-user-to-save-changes-when-they-exit

Thanks!!

[QUOTE=TechGuy;17740]If a user makes a change to a record and then clicks the arrow to move on to the next record, the changes are not saved. If something has changed, I’d like to at least show a warning such as, “Are you sure that you want to leave without saving changes?”

I found this old thread, but was hoping that there might be an easier solution since it was 4 years ago:
http://www.scriptcase.net/forum/showthread.php?137-Can-you-make-a-form-prompt-the-user-to-save-changes-when-they-exit

Thanks!![/QUOTE]

What do the other programmers for this need ?
As we know, users can easily forget to save data.

I also try to find a way to do this ? There is nothing in the examples or help manual !

I do not think it necessary. That is what the user then make only once … I would not waste time on that.

Most of my users make the mistake more than once. And we keep getting new users to go through the learning process. And even if they only make it once, there is a significant amount of effort required by programming to clean up after their mess because product got shipped wrong, or too much, or databases need to be manually ‘fixed’.

Seriously, this would be a very excellent feature for scriptcase, since it is a rather complicated process to implement yourself, and would rely on understanding the code that they generate (which will eventually get broken during an upgrade).

I’m rather shocked that there isn’t already a solution for this…

Agreed. This would make a great addition.

Thinking it out a bit by … The server does not know whether someone has changed a field, because that happens in the workplace and only when the update button is clicked can respond …

Reinhard,

It would most likely involve Javascript code running in the browser to watch for fields that get changed. That would be a fairly efficient way to do it. SC currently will allow you to assign some Javascript to each field’s ‘onchange’ event. But there is not a way to catch the navigate event to advance to the next record.

You could involve the server. At some point, there is an event that causes the browser to display the next row. This may or may not involve a trip to the server to get the next row information, so it would be possible to send everything back to the server to be checked. but that would involve a lot of unnecessary traffic and delays.

Hello,

I have just sent your suggestion to our team.

regards,
Bernhard Bernsmann