Hi
I have a html form here on an ASP page.
If you fill the form in, hit submit, then have to hit the back button to ammend the form, say, to use a different usename, or password, previously input details have dissapeared. Obviously this is a right pain.
Does anyone know of a bit of Javascript to stop this happening, so details are kept on the form, except where the details have to be ammended, for example, as above.
I have already submitted to the javascript forum, and had the replies in quotes below:
QUOTE 1
"I dont think Javascript can help. It works within the current page. Every request for a new page starts afresh. Submit and Back are requests for new pages. Not new to the person maybe, but new to the browser.
So you have to catch the form data when the form is submitted the first time. You must keep this data in session variables. And you must keep track of the fact that the form has been submitted. I dont know that you can keep track of whether the form has been requested by clicking the Back button specifically. But you can arrange the process in user.asp to assume that a subsequent request results in displaying the form with the fields filled with the data in the session variables."
QUOTE 2
"i believe it has something to do with browser cacheing. i know in php there is a single line of code that you can put on the top of your php page to enable this.
possibly, something similar exists in asp.
javascript is not the ideal solution."
Anyone got any ideas?
Matt
I have a html form here on an ASP page.
If you fill the form in, hit submit, then have to hit the back button to ammend the form, say, to use a different usename, or password, previously input details have dissapeared. Obviously this is a right pain.
Does anyone know of a bit of Javascript to stop this happening, so details are kept on the form, except where the details have to be ammended, for example, as above.
I have already submitted to the javascript forum, and had the replies in quotes below:
QUOTE 1
"I dont think Javascript can help. It works within the current page. Every request for a new page starts afresh. Submit and Back are requests for new pages. Not new to the person maybe, but new to the browser.
So you have to catch the form data when the form is submitted the first time. You must keep this data in session variables. And you must keep track of the fact that the form has been submitted. I dont know that you can keep track of whether the form has been requested by clicking the Back button specifically. But you can arrange the process in user.asp to assume that a subsequent request results in displaying the form with the fields filled with the data in the session variables."
QUOTE 2
"i believe it has something to do with browser cacheing. i know in php there is a single line of code that you can put on the top of your php page to enable this.
possibly, something similar exists in asp.
javascript is not the ideal solution."
Anyone got any ideas?
Matt