87,907
社区成员
发帖
与我相关
我的任务
分享
Array.prototype.indexOf = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] == val) return i;
}
return -1;
};
Array.prototype.remove = function(val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
function sele(_this){
if(_this.style.backgroundImage==""){
mark++;
set(_this.id);
_this.style.background='#C0C0C0';
_this.style.backgroundImage="url(images/mark.png)";
_this.style.backgroundRepeat="no-repeat";
_this.style.backgroundPosition="right top";
}else{
mark--;
unset(_this.name.value);
_this.style.background='';
_this.style.backgroundImage="";
}
}
function set(id){
if(fs==null){
fs = new Array();
}
var len = fs.length;
fs[len+1]=id;
}
function unset(id){
var index = fs.indexOf(id);
if(index!=-1){
fs.remove(index);
}
}
function putin(){
//给表单中的隐藏域赋值,
document.all.fs.value=fs;
}
//数组
var fs;
//数组索引
var mark = 0;
var allcb = $("form.frm input[type='checkbox']:[checked]");
var cids = [];
for ( var i = 0; i < allcb .length; i++) {
cids.push($(allcb[i]).val());
}
if (cids.length<1) {
alert('请选择邀请的好友。');
return false;
}