bergy
Posts: 14
|
| Posted: 10/25/2006, 8:51 AM |
|
Hi all,
Is there a way to know if someone has performed some changes on a record
form before he click on the submit button. The form has several links and sometime
people update the record and then click on a link without clicking on the submit to validate
the changes.
I am trying to prevent change loss.
Thanks in advance,
Stephan
|
 |
 |
Edd
Posts: 547
|
| Posted: 10/25/2006, 8:01 PM |
|
You will need to have a timestamp in your database table and your form.
For updates and deletes compare the Key and the Timestamp so no records overwrite changes. Do this through custom updates and inserts.
You may want to do an onValidate routine as well.
Edd
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
roeya
Posts: 181
|
| Posted: 10/26/2006, 12:13 AM |
|
I have the same problem:
To solve it you need JavaScript –
1.Ensure you have OnChange event for every field in the form.
2.In the OnChange Handler ensure that you save all the form parameters to a Cookie.
3.In the OnLoad of the page update the forms fields from the Cookie.
4.Add OnClick event in the server side that deletes the Cookie.
Now whenever someone clicks away to another page after a change to the form was made and then returns back the form will be the updated one.
A simple solution will be to open the new link in a new window (chnge the taget attribute of the link to _blank), however if you have the problem we had (Updating possible list box values) it will not help
I think you can find a readymade solution somewhere in the Internet, anyway I will let you know If we find something or we decided to develop our own solution.
_________________
http://www.infoneto.com/ |
 |
 |
bergy
Posts: 14
|
| Posted: 10/26/2006, 9:44 AM |
|
Thanks for your suggestion.
I will try this one.
1. create a hidden field called isFromChanged (boolean) with default value to false.
2. create an OnChange event on every field in the form. The event will change the value of
isFormChanged field to true.
3. create an OnBeforeUnload event on the page that check the value of isFromChanged
and if true then display a messagebox with warning.
I will keep you in touch
Stephan
|
 |
 |
bergy
Posts: 14
|
| Posted: 10/26/2006, 9:49 PM |
|
Quote bergy:
Thanks for your suggestion.
I will try this one.
1. create a hidden field called isFromChanged (boolean) with default value to false.
2. create an OnChange event on every field in the form. The event will change the value of
isFormChanged field to true.
3. create an OnBeforeUnload event on the page that check the value of isFromChanged
and if true then display a messagebox with warning.
I will keep you in touch
Stephan
Hi,
Just to let you know this solution works fine for me.
Stephan
|
 |
 |