日期:2014-05-16 浏览次数:20424 次
function GetContactluk(sid,bid,cid,did){
var aa = document.getElementById(sid).value;
var ab = document.getElementById(bid).value;
var ac = document.getElementById(cid).innerHTML;
var m=did.split("_")[0];
var n=did.split("_")[1];
var v=","+aa;
if(v.indexOf(did.split("_")[0]) > 0) {
//ac = ac.replace(/[\r\n]/g,"") //去掉回车
//alert(ac)
aa = aa.replace(new RegExp(m + ",","g"),"").Trim();
ab = ab.replace(new RegExp(n + ",","g"),"").Trim();
ac = ac.replace(new RegExp("<li>"+ n + "</li>","g"),"").Trim();
document.getElementById(sid).value =aa.replace(/\n[\s ]*\r/g,""); //替换空行
document.getElementById(bid).value =ab.replace(/\n[\s ]*\r/g,"");
document.getElementById(cid).innerHTML =ac.replace(/\n[\s ]*\r/g,"");
}else{
document.getElementById(sid).value = aa + m + ",";
document.getElementById(bid).value = ab + n + ",";
document.getElementById(cid).innerHTML =ac + "<li>" + n +"</li>";
}
}