function RegIDContainer(RegID)
{
         spilthInfoValues = document.getElementById("SpilthInfoRegID").value;
         spilthInfoValues==""? spilthInfoValues=RegID: spilthInfoValues+=","+RegID;
         alert(spilthInfoValues);
}这样行不?

解决方案 »

  1.   

    看错了,不好意思。
    如果每次都取SpilthInfoRegID的值的话,在此基础上加,再回传给SpilthInfoRegIDfunction RegIDContainer(RegID)
    {
             spilthInfoValues = document.getElementById("SpilthInfoRegID").value;
             spilthInfoValues==""? spilthInfoValues=RegID: spilthInfoValues=","+RegID;
             alert(spilthInfoValues);
             document.getElementById("SpilthInfoRegID").value = spilthInfoValues;
    }
    如果不用每次都取SpilthInfoRegID的值的话,
    把spilthInfoValues = document.getElementById("SpilthInfoRegID").value;拿到RegIDContainer(RegID)的外面。
    再function RegIDContainer(RegID)
    {
             spilthInfoValues==""? spilthInfoValues=RegID: spilthInfoValues+=","+RegID;
    }全调用完了再document.getElementById("SpilthInfoRegID").value = spilthInfoValues;