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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preserving the state of browser

Status
Not open for further replies.
Oct 11, 2006
300
US
Hi,

Has anybody worked with this kind of scenario? I am working on a hierarchial tree which I can expand and collapse. However when I submit the form elements and come back to this page, the tree is collapsed and then I cannot see the element which I selected until I expand the tree again to see my prior selection.

I am working on this, but do not know what I am missing.

Code:
function s_Hide(el){
	obj = document.getElementById(el).style;
	(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
	get_cookie(Name);
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

window.onLoad = get_cookie(Name);
 
You've been asking a lot of questions around here lately and getting some in-depth responses. Have you found the responses helpful? To indicate that someone has helped you, look at the bottom left of the posting and click on the "Thank ExpertName for this valuable post!" A window will pop up to confirm that you meant to do this, and a little purple star will appear in the future next to that person's name in the thread.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top