Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger JS with asp?

Status
Not open for further replies.

crabgrass

Technical User
Aug 29, 2007
111
0
0
US
I have a page that initially loads in non editing mode (all the controls are readonly). A series of JS routines is run when the user clicks the edit button to turn off the readonly attributes and disable various buttons so he doesn't screw things up while editing.

During the onchange of one control a JS routine runs to update values in the source table and reload the page so these new values will be shown. The page comes back in non editing mode as you would expect.

I would like to have the page come back in editing mode if possible meaning at the end of the load we would again run the JS code to open it up. Is there a way to do this?
 
Set a cookie with ASP and then check it when the page loads to see which mode to set. Be sure to delete the cookie after checking it so it doesn't affect future page loads.

Lee
 
Thanks. There are various ways to identify the needed page state. My problem is how to trigger the JS when the page loads.
 
Check the cookie value when the page loads.

JS routine runs to update values in the source table

Have that JS function set the cookie showing the page should be in edit mode. When the page loads, check for the cookie and, if there is one, change the page to edit mode and delete the cookie at that time. It can be recreated if edit mode is continued.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top