Click to See Complete Forum and Search --> : How do I maintain user value and prevent it from going back to default value


sarasahg
12-20-2005, 05:03 AM
I have funtion that set the default value of a text box. How do i maintain the text value to the user enter value not the default value When user click on the back button to the current page. This function is call onload at the body is becouse of this the value goes back to default value. Please give me any suggestion how i maintain the user entered value and set the default value at the same time.
thank you.
:confused: :)

Kravvitz
12-20-2005, 05:56 AM
Why are you setting the defaultValue with JavaScript?

You could store the value in a temporary variable and then set it back after you set the defaultValue.

tabzter
12-20-2005, 10:50 AM
an easy tip:

when the user clicks on the button to go to the next page then automatically change the value in the textbox back to the default value.

But like Kravvitz says javascript is probably not the ideal language for cross-page support.

felgall
12-20-2005, 02:01 PM
Cross page support with Javascript requires one of the following:

1. frames
2. cookies
3. adding variables to the end of the URL

Only by using one of these three can you pass a Javascript variable from one page to the next.