Solved

Selected object style changes lost when user hits BACK

Posted on 2007-04-03
2
157 Views
Last Modified: 2010-04-09
I have a web application using ASP, with scripting in VbScript.      The main page is a menu, with 3 frames, each filled with buttons.       Essentially, the users chooses one button in frame 1, which leads to a group of buttons available in frame 2, then frame 3.     Once a button is chosen in frame 3, a ASP form is submitted, which loads the document the user selected.      
I am using the following script:

function myfile_click(f_id)
      Files_form.myFile.value=f_id
      window.event.srcElement.className="Selected_Button_style"
      Files_form.submit
end function

which successfully changes the style of the buttons that are selected.

Here is the question (I believe it may be a very simple question):       After viewing the document, when I hit the browser 'back' button, I return to the menu page, however the buttons that were coloured to indicate they were the last selection are no longer marked.      It doesn't look like the page has been loaded again.

The only event I am trapping is OnClick (to change the style of the selected button).    I am not using any other events.    I am setting a default style for the button when the button is created (using a script).

Any idea how to avoid this?       I want the menu screen to style show the last selected buttons when the user is finished reading the document, and hits back.
    thanks,
            PvBredow
0
Comment
Question by:PvBredow
2 Comments
 
LVL 11

Accepted Solution

by:
flipz earned 250 total points
ID: 18842289
I may be mistaken but I believe the only state that is retained in history is the value of controls on the page (textbox, select lists etc.) - not styles that were changed client-side. I think you'll have to retain the style information and pass it along in your form submission. Then change the 'back' button to reload the last page and pass it the new defaulted style info instead of using history.back(). It sounds like a bit of work but I believe it is the only way - if I am wrong then I'd like the hear the answer too.
0
 

Author Comment

by:PvBredow
ID: 18922968
I can live with that.   Just thought if there was a simple way to deal with it, it would be worth pursuing.

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now