Published in: JavaScript
function setSelectListToValue(){ var i, si, v, args=setSelectListToValue.arguments; if ((obj=document.getElementById(args[1])) != null){ v = args[0]; for(i=0; i<obj.length; i++){ if(obj.options[i].value == v){ //alert(i); si = i; } } //alert(obj.length); obj.selectedIndex = si; } }
You need to login to post a comment.
