A
Aaron
I have 2 listbox server controls on my page that I've written a few js
functions to move the options between them. All works fine, except
when I call my function to re-sort the lists. After the items are
removed from one list and added to another, the following is called
passing the "list to be sorted" in as an object. If I put a simple
alert in after the sort method, it works fine. Once I remove the
alert, I get the "Unspecified error" blah blah blah.
Any thoughts?
Thanks
- Aaron
function sortList(l){
var holdValue = new Array()
for(j=0;j<l.length;j++){
holdValue[j] = l[j].value
}
holdValue.sort()
//UNREM THIS.. AND IT WORKS FINE
//alert("Looking OK")
l.length=0
for(j=0;j<holdValue.length;j++){
var o = new Option(holdValue[j],holdValue[j])
l.add(o)
}
}
functions to move the options between them. All works fine, except
when I call my function to re-sort the lists. After the items are
removed from one list and added to another, the following is called
passing the "list to be sorted" in as an object. If I put a simple
alert in after the sort method, it works fine. Once I remove the
alert, I get the "Unspecified error" blah blah blah.
Any thoughts?
Thanks
- Aaron
function sortList(l){
var holdValue = new Array()
for(j=0;j<l.length;j++){
holdValue[j] = l[j].value
}
holdValue.sort()
//UNREM THIS.. AND IT WORKS FINE
//alert("Looking OK")
l.length=0
for(j=0;j<holdValue.length;j++){
var o = new Option(holdValue[j],holdValue[j])
l.add(o)
}
}