?
Solved

Selected object style changes lost when user hits BACK

Posted on 2007-04-03
2
Medium Priority
?
186 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 750 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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)
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…
Suggested Courses

777 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