Skip to main content
Participant
March 18, 2010
Question

losing data when page is refreshed

  • March 18, 2010
  • 1 reply
  • 1056 views

Hi all

I have .cfm page which has fields which can be entered by the user , and also they can add an attachment to this page. problem is when the users enter the fields and after they add the attachment, the page gets refreshed and the data they entered is lost.

how can i handle this??

This topic has been closed for replies.

1 reply

ilssac
Inspiring
March 18, 2010

Why is the page refreshed?  What state is the data in?

If this is all happening on the client you will need to use sometype of client mechnism to maintain the form state.  That is nearly always JavaScript.

If you care to go to full blown AJAX, you can use that JavaScript to send and receive data from the server.

If the page is being submitted, but the same form page is being returned, then you can just use server tecniques to maintain state.  One very common technique is to store the form data in session variables until it is ready for more permanent storage.

cfanilAuthor
Participant
March 18, 2010

Hi

Problem is

I have many tabs in the page and if i enter data in the first tab and click the second tab to add some content I have a  pop up window. when I enter data in the popup and submit that the entire page gets refreshed and the data I enter in the first tab is lost. Is there any way I can avoid this refresh ????so that I wont loose data..

Thanks In Advance

ilssac
Inspiring
March 18, 2010

Yes, but how you do this is going to depend on how well you understand the client layer and the server layer in the HTTP request and response cycle.

What type of popup are you using?

How comfortable are you with using xmlHTTPRequest() javascript objects, aka AJAX.

How about inline frames?