[code=ASP] Set Rs=Connbbs.Execute("Select FirID From LxTel_Friend Where UserID="&Request.Cookies(BBSInfo&"userid")&"")
If Not Rs.Eof Then
i=0
Do While Not Rs.Eof
Set Rs2=Connbbs.Execute("Select * From LxTel_User Where ID="&Rs(0)&" and [ID] not in(select to_userID from
[cat_recommend] where [send_userID]="&send_userID&" and [send_CID]="&Request("ID")&")")
if not Rs2.eof then
Message=Message&Rs2(0) '要发送的信息内容控制变量
Str2=Str2&"<td><INPUT onclick=changechecked(this) type=checkbox value="&Rs2(4)&" name=""touser"">"&Rs2(4)
&"</td><td><input type=""hidden"" name=""message"" size=""51"" value="&Message&"></td>"
Message="券名:"&ContentName&" 地
址:"¤tlyUrl&"&send_userID="&send_userID&"&send_CID="&Request("ID") '要发送的信息内容控制变量
Connbbs.Execute("Insert Into [cat_recommend] (send_userID,to_userID,send_CID,LOCK) Values
("&send_userID&","&Rs2(0)&","&Request("ID")&",0)")
else Str2="<td align=""center"" style=""color:blue"">您已经给您的所有用户使用过了!</td>"
end if
Set Rs2=Nothing
Rs.Movenext
i=i+1
if i mod 3=0 then
Str2=Str2&"</tr><tr height=30>"
end if
Loop
End If
Set Rs=Nothing
Str=Str&Str2
Str=Str&"<tr><td height=""30"" colspan=""3""><INPUT onclick=selectall(this.checked) type=checkbox name=clickall>全选
</tr><tr><td height=""30"" colspan=""3"">推荐理由: <input name=""title"" type=""text"" size=""50"" value=""我给你推
荐一个好东西""></td></tr><tr><td height=""35"" colspan=""3""><input type=""hidden"" name=""sendser"" value="&Request.Cookies
(BBSInfo&"UserName")&"><input value=""发送"" type=""submit"" onclick=""return resultlistcheck()"" style=""width:80px;
height:25px;""> <input value=""关闭"" type=""button"" onClick=""document.getElementById
(\'light\').style.display=\'none\';document.getElementById(\'fade\').style.display=\'none\'"" style=""width:80px;
height:25px;""></td></tr></table></FORM></div>" [/code]
function selectall(v){
alert("111111");
var f = document.forms["resultlist"];
for (i=0;i<f.elements.length;i++)
if (f.elements[i].name=="touser") f.elements[i].checked = v;
document.forms["resultlist"].elements["clickall"].checked = v;
}
var checkflag = "false";
function resultlistcheck()
{
if(document.resultlist.title.value=="")
{
alert("推荐理由不能为空!");
this.resultlist.title.focus();
return false;
}
if(document.resultlist.touser.length>1){
for(i=0;i<document.resultlist.touser.length;i++){
if(document.resultlist.touser[i].checked == true)
{
checkflag=true;
}
}
}else{
if(document.resultlist.touser.checked == true)
{
checkflag=true;
}
}
if (checkflag=="false")
{ alert("您还没有选择要推荐的好友! ^^");
return false;
}
else return true;
}
请问:1、为什么我没有勾选的checkbox它也选择了,这个问题怎么解决。
2、全选的checkbox没起作用,实在不知道是什么原因,请高手帮我看看。
不管是路过的还是专程拜访的,都请帮小弟看看,谢过了!~~