Hello,
I am a bit a loser with JavaScript, but I found the following code to auto scroll a multiple select box to the last selected item.
Function autoscroll()
{
var lst = From1.Listbox1
if ((lst.multiple==true) && (lst.length>0)) {
if (lst[lst.length-1].selected==true) {
lst[lst.length-1].selected=true;
return;
}
else {
lst[lst.length-1].selected=true;
lst[lst.length-1].selected=false;
}
for (var i=0; i< lst.length;++i)
if (lst.selected==true) {
lst.selected=true;
return;
}
}}
But when I put it in my code it does notting.
I have 3 multiple select list boxes that all must scroll to the latest selected item in the list.
When the user clicks on it, the onclick event is called: onclick="submit()"
Does anyone know how to get the above function work?
Thanks before!