Copy link to clipboard
Copied
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??
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I just used window.open for the pop up , so when ever i submit the pop up the parent window gets refreshed.
I am not familiar with ajax or inline frames
help me please
Copy link to clipboard
Copied
<iFrame...> is an HTML tag that allows you to create a part of the web browser that is a seperate container for requests and responses. Thus you can submit a form in a frame and it does not affect the user interface outside of the frame.
AJAX uses the xmlHTTPrequest() object to make reqeusts and get responses behind the scenes so that you do not need to refresh the browser to create a request/response cycle.
window.open does not have either of these features. Submitting a form in the popup window is going to generate a request for the entire browser.
Copy link to clipboard
Copied
Regarding:
so when ever i submit the pop up the parent window gets refreshed.
That would because of code that you wrote based on a decision you made. What was the rationale for that decision?