我有以下代碼:如何刪除選擇字段中的列表選項項?
function removeUsers()
{
var removedUsers = document.getElementById('<%=removedUsers.ClientID%>');
var lbCurrent = document.getElementById('<%=lbCurrent.ClientID%>');
if (lbCurrent && lbCurrent.selectedIndex != -1)
{
for(i=lbCurrent.length-1; i>=0; i--)
{
if(lbCurrent.options[i].selected)
{
//add the removed user to the removedUsers var
removedUsers.value += lbCurrent.options(i).value + ";";
lbCurrent.options[i] = null;
}
}
}
selectAllItems();
}
這造成我的問題在Firefox:
removedUsers.value += lbCurrent.options(i).value + ";";
能
別人的幫助?
由於
沒有相應的HTML這是沒有意義的。 – 2012-03-06 15:49:17
另外,你可以發表渲染的腳本?由於'<%= removedUsers.ClientID%'在服務器端看起來很可疑。 JavaScript適用於客戶端,因此我們需要查看呈現的HTML/JavaScript,如'view source'所示。 – 2012-03-06 15:51:40