Saving text fields without submitting

liunx

Guest
I have a form where the user enters a bunch of information (this is the display page). On this page, the user must select a hotlink (A HREF) to upload a file (the upload page). After this task, the user then returns to the original display page and can submit it. <br />
<br />
The problem is a simple one. The values entered in all the text fields are cleared once the user selects on the hotlink. Obviously, I would like to save all these values so that when the user returns to the original form (by pressing the "Return" button), these values are still there.<br />
<br />
Example:<br />
<br />
Display page:<br />
<br />
<FORM ACTION="ActionPage.cfm" METHOD="post" NAME="displayform" ID="displayform"><br />
<A HREF=http://www.htmlforums.com/archive/index.php/"UploadPage.cfm">Press Me!</A> <br />
<BR><br />
<INPUT TYPE="text" NAME="field_name" VALUE=""><br />
<BR><br />
Other display page stuff goes here....<br />
<BR><br />
<INPUT TYPE="submit"><br />
</FORM><br />
<br />
Upload page:<br />
<br />
This is the upload page.<br />
<BR><br />
<FORM ACTION="DisplayPage.cfm" NAME="Uploadform" ID="Uploadform"><br />
<BR><br />
Upload stuff goes here....<br />
<BR><br />
<INPUT TYPE="submit" VALUE="Return"><br />
</FORM><br />
<br />
I keep getting the run around as I can't get a straight answer (or at least an answer that makes sense). If anyone can give me a clue as to where I am going wrong and explain it to me in a simplified manner, it will be much appreciated. Thanks!<!--content-->I personally don't think you can. I have been known to be wrong, though and will look into it further. :)<!--content-->I can help you out, but I am a bit unsure of what your trying to accomplish.<br />
<br />
Do you mean your trying to allow the user to UPLOAD a file to the server, along with form information?<br />
<br />
If this is the case, your in a bind. I also use coldfusion as my web server (go rad!). The problem I found is that I could not upload files WITH form data. Ok, so I created a cfm frameset which housed two different forms... one for the form data, and one for the file upload. <br />
<br />
Then all info was maintained while you were uploading files..... and then when you submitted the main form, the action page replaced the page as _top.<br />
<br />
let me know if you need some more help. There are other ways..... but they are messy.<!--content-->Thank you both for your reply.<br />
<br />
No, I am not trying to do what you are describing. <br />
<br />
I'll try and explain it on the simplist terms (please note: uploading a file is irrevelant in this case).<br />
<br />
I have three forms: form1, form2, and form3. On form1, I am posting to form3 (i.e. all text field values are sent to form3). <br />
<br />
However, to finish entering form1, the user must access form2 via a hotlink (it doesn't really matter why, it's just important to note that they are leaving form1). When the user does whatever they need to do on form2, they will press a return button to go back to form1. <br />
<br />
Here lies the problem. When the user is taken back to form1, the values are cleared. <br />
<br />
I want these values to remain, but since I am not submitting the form, I don't see how to do so.<!--content-->Sounds like you're looking for client-side persistence; without using cookies here, your best bet is to 1)pass any user-entered form values on form1 to hidden fields on form2 and 2)script them back onto form1 when the user returns (using the url of the 'return' button) - if I'm following this correctly. How? Use the url's query string. Since HTTP is stateless, there aren't a lot of client-side options; this is a useful one to retain form data (although Netscape tends to retain it even when you don't want it to). For more, see:<br />
<br />
<!-- m --><a class="postlink" href="http://www.faqts.com/knowledge_base/view.phtml/aid/969/fid/124">http://www.faqts.com/knowledge_base/vie ... 69/fid/124</a><!-- m --><br />
<br />
<!-- m --><a class="postlink" href="http://developer.netscape.com/viewsource/goodman_url_pass/goodman_url_pass.html">http://developer.netscape.com/viewsourc ... _pass.html</a><!-- m --> (particularly the subhead Passed Data Can Be Used to Fill Forms, Too<!--content-->In IE5 you can use the userdata behavior to store local data.<br />
See <!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtmlrefs.asp">http://msdn.microsoft.com/library/defau ... mlrefs.asp</a><!-- m --><br />
for more information.<br />
Outside IE5, you can either set a cookie, or use the search property of the URL.<!--content-->
 
Back
Top