PDA

View Full Version : remeber item selected


rutin
10-24-2005, 11:17 PM
I have a small java script, which show and hide layers.
Iside of the is a bullted list. So when u click on first, it expand all list.

How can i make this script, remeber last item selected.



Bullted list is implemented with php.
Again, very simple function.


Can you help me?

my script !


<script type="text/javascript" >

if (document.all) document.getElementById = document.all;
var dhtml = (document.getElementById || document.all) && navigator.userAgent.indexOf('Opera') == -1 ? true : false;




function getE(objectID) {
return document.getElementById(objectID);
}
function showhide(what) {
var w, text;
w=what.parentNode;
if (
w.className=="closed"
) {
w.className="open";
what.src="navigace_minus.gif";
} else {
w.className="closed";
what.src="navigace_plus.gif";
}
return false;
}
</script

scrypter
10-25-2005, 12:43 AM
Try a hidden field to store the selectedIndex, You can get at this value with PHP when postback, (or maybe use AJAX) and store it somewhere.

HTH
Paul