ASP: How to preserve html form field values?

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
There's no way you can influence that from the server side, at least for a simple refresh. Firefox keeps the form values when you do a refresh, though. It seems rather stupid for a browser to erase the values :confused: Unless, can you capture a refresh even in javascript?...

If the user actually submits the data then you can do as mooby suggested and record the value entered somewhere and put it into the form the next time it's requested.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
Use AJAX to asynchronously post the data to the server?

I used that on one of my web apps - users could enter a very long free text response - this provided an autosave feature in compatible browsers (not opera).
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Ooh, very nice :) How often did you save? On a timer, or onblur of the text boxes?
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
How often did you save? On a timer, or onblur of the text boxes?

Every minute, or every 100 keypresses on the text box (which ever comes first). This was fine for a very lightly loaded intranet site, but may need tweaking for a public site.
 

SONYFX

Senior member
May 14, 2003
403
0
0
Originally posted by: Mark R
Use AJAX to asynchronously post the data to the server?

I used that on one of my web apps - users could enter a very long free text response - this provided an autosave feature in compatible browsers (not opera).


Can you give me an example? Thanks!
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
Can you give me an example? Thanks!

I can't show you a demo site because the app was written for internal institutional use, and is not publicly available.

I also don't have a publicly accessible server running ASP.NET so couldn't just set you up a demo. Sorry.
 

torpid

Lifer
Sep 14, 2003
11,631
11
76
May I ask why you want to do this? Just want to make sure you are thinking clearly. If you make it keep the user's values, you need to also have a reset button to clear the values. Plus if this is a site where users won't come often, it's going to confuse them.
 

mAdMaLuDaWg

Platinum Member
Feb 15, 2003
2,437
1
0
Originally posted by: Mark R
Can you give me an example? Thanks!

I can't show you a demo site because the app was written for internal institutional use, and is not publicly available.

I also don't have a publicly accessible server running ASP.NET so couldn't just set you up a demo. Sorry.

And he's using ASP.. not ASP.NET