Modification by JavaScript function won't stay, why?

G

Guest

Hello, friends,

I have a .aspx page, which may change label text based on a user's
selection. For example, if a user select Visitor from a drop-down HTML
control, corresponding label will be changed to Visitor's Name from original
value (Member's Name) by using a JavaScript function. It worked fine.

However, if I moved to next page and then clicked Back button of IE back to
this page again, all the label text were changed back to its original value
(Member's Name in above example), although in drop-down it was still the
correct value (Visitor in above example).

Why and how to fix this problem? Any sample source code?

Thanks.
 
B

Bruce Barker

when the user goes back, the unchange event for the select does not fire
(because the select has a new value), so the context remains as originally
rendered. the browser only caches the original page html, and field values.

you need to add client script to do the work on page load to handle this
case.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top