Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Selected object style changes lost when user hits BACK

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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).

610 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