Solved

Selected object style changes lost when user hits BACK

Posted on 2007-04-03
2
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

705 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