Solved

Selected object style changes lost when user hits BACK

Posted on 2007-04-03
2
146 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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This article discusses how to create an extensible mechanism for linked drop downs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

762 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

10 Experts available now in Live!

Get 1:1 Help Now