Forum Moderators: open

Message Too Old, No Replies

How to call function with javascript?

         

toplisek

10:52 am on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I have function to set size of list box in Mozilla like:
function autoExpandSELECTs() {
var sels;
var i=0, end = 0;
if (document.getElementsByTagName) {
sels = document.getElementsByTagName('select');
for (i, end = sels.length; i < end; i++) {
if (sels[i].multiple) {
sels[i].size = sels[i].options.length;
}
}
}
}

How to call the autoExpandSELECTs function in the window onload and define size of List box?

RonPK

1:47 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe I'm missing something, but what about
<body onload="autoExpandSELECTs()">
?