I have page1, page2, etc.
On page1 there is a link to navigate to page2. Also there is a form on page1 that user fills in and submits. If user enters details on this form and clicks on the page2 link without submitting the form I would like to prompt the user whether he wants to save or not. If user says yes, I need to save the form and stay in the same page. If user says no, I need to proceed to next page without saving it. I want to do this action in the web-tier.
Rohithaksha Kalluraya wrote:If user says yes, I need to save the form
What gmail does is that it keeps making ajax requests at regular time intervals and sends all the form data (the email in case of gmail) to a specific servlet/struts action on the server which saves the values somewhere (in drafts folder in case of gmail). That's what you need to implement too. The exact implementation details will depend on your requirements...
subject: Saving the form before navigating to some other page