br*********@pwgsc.gc.ca wrote:
I have a Select list with a size of 10, but with more than 10 options
in the list. After I select an item and submit the form I would like
the list be scrolled down to show the previously selected item still
selected
You can try
<head>
...
<script type="text/javascript">
function scrollSelect()
{
var s = document.forms[...].elements[...];
s.selectedIndex = s.selectedIndex;
}
</script>
</head>
<body onload="scrollSelect()">
...
</body>
but there is no guarantee that it will work as supposed.
and displayed at the top of the Select box.
If you think about this further, you will recognize it cannot be done for
every item.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>