私は次のコードを持っている:これは私のFirefoxでの問題の原因となっている選択フィールドでリストオプション項目を削除するにはどうすればよいですか?
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();
}
を:
removedUsers.value += lbCurrent.options(i).value + ";";
を誰かが助けることはできますか?
おかげ
付随するHTMLなしでは意味がありません。 –
また、レンダリングされたスクリプトを投稿できますか? '<%= removedUsers.ClientID% 'はサーバサイドでは疑わしく見えます。 JavaScriptはクライアント側で動作するので、 'view source'の下に表示されたHTML/JavaScriptを表示する必要があります。 –