He he auguri
stò riprogettando il nuke del mio sito e questa è la pagina che gestisce le news (dà finire)...cmq la checkbox da controllare è quella chiamata "flag" ah il java per selezionare tutte le checkbox funzia
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
' acp_news.asp v. 1.0.00
' Prima relase iniziata Domenica 3 Ottobre 2004 alle ore 0.13
' Copyright: (C) 2004 Dazeroacento.com
' Email: maxsona@dazeroacento.com - maxsona@tiscalinet.ir
%>
<html>
<head>
<title>:: Administrator Control Pannel - Dazeroacento.com - News ::</title>
<link rel="stylesheet" href="../styles/OrangeBlue/stile.css">
</head>
<body>
<%
' Rileviamo la pagina da visualizzare dalla stringa dell'URL
If pag="" Then
pag = 1
Else
pag = CInt(pag)
End If
%>
<script language="JavaScript">
<!-- Questo java permette di selezionare/deselezionare tutti i record con un click nella prima checkbox
function CheckAll()
{
for (var i=0;i<document.TheForm.elements.length;i++)
{
var e = document.TheForm.elements[i];
if (e.name != "checkall")
e.checked = document.TheForm.checkall.checked;
}
}
//-->
</script>
<script language="javascript">
function controllavalore(){
var cc = document.TheForm.checkdoc;
var almenouno=false;
if(cc.length){
for(i=0;i<cc.length;i++)
if(cc[i].checked)almenouno=true;
}
else{
almenouno = document.TheForm.checkdoc.checked
}
if(!almenouno){
alert('Devi selezionare almeno un record !');
return false;
}
else return true;
}
</script>
<table width="982" cellpadding="0" cellspacing="0" class="MainTable">
<tr>
<td>
<table width="981" border="0" cellpadding="0" cellspacing="0" class="SubMainTable">
<tr>
<td colspan="5"></td>
</tr>
<tr>
<td width="10"></td>
<td width="160"></td>
<td width="20"></td>
<td width="781"><table width="781" border="0" cellpadding="0" cellspacing="0" class="HeadDataTable">
<tr>
<td width="130">[img]../styles/OrangeBlue/news.gif[/img]</td>
<td width="555" background="../styles/OrangeBlue/top_bg.gif"></td>
<td width="96" rowspan="2">[img]../styles/OrangeBlue/icon_news.gif[/img]</td>
</tr>
<tr>
<td colspan="2">
<table width="685" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8">[img]../styles/OrangeBlue/top_border_left.gif[/img]</td>
<td class="HeadDataTd"><div align="center">Elenco news, nel database sono presenti # articoli </div></td>
</tr>
</table></td>
</tr>
</table>
<table width="781" cellpadding="0" cellspacing="0" class="DataTable">
<form method="POST" form name="TheForm" action="acp_news.asp" onsubmit="return controllavalore()">
<tr>
<th width="25" height="25" nowrap class="DataTdTitle">#</th>
<th width="120" nowrap class="DataTdTitle">Autore</th>
<th width="65" nowrap class="DataTdTitle">Data</th>
<th nowrap class="DataTdTitle">Titolo</th>
<th width="45" nowrap class="DataTdTitle">Stato</th>
<th width="25" nowrap class="DataTdTitle"></th>
<th width="25" nowrap class="DataTdTitle"><input name="checkall" type="checkbox" id="checkall" value="" onClick="CheckAll();"></th>
</tr>
<%
' Creo la stringa SQL
SQL="Select news_id, news_author, news_data, news_title, news_status from dazeroacento_news ORDER BY news_id DESC"
Set news_rs = Server.CreateObject("ADODB.Recordset")
' Settiamo il numero di record per pagina
news_rs.PageSize = 10
news_rs.Open sql, conn, 3, 3
news_rs.AbsolutePage = pag
' Creo il record set
For i=1 to news_rs.PageSize
%>
<tr>
<td height="25" class="DataTdData"></td>
<td height="25" class="DataTdData"><div align="center"><%=news_rs("news_author")%></div></td>
<td height="25" class="DataTdData"></td>
<td height="25" class="DataTdData"></td>
<td height="25" class="DataTdData"><div align="center"><%if news_rs("news_status")=true then%>[img]../styles/OrangeBlue/acp/icon_active.gif[/img]<%else%>[img]../styles/OrangeBlue/acp/icon_inactive.gif[/img]<%end if%></div></td>
<td height="25" class="DataTdData"></td>
<td height="25" class="DataTdData"><div align="center"><input name="flag" id="flag" type="checkbox" value="<%=news_rs("news_id")%>"></div></td>
</tr>
<%
' Chiudo il recordset
news_rs.MoveNext
If news_rs.EOF Then Exit For
Next
%>
<tr>
<td background="../styles/OrangeBlue/bg1.gif" height="31" colspan="7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="31" valign="middle"><input name="submit" type="submit" value="Cancella selezionati"></td>
<td width="145"><div align="center" class="nav">PrecedenteSuccessiva</div></td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<table width="781" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8">[img]../styles/OrangeBlue/bottom_left.gif[/img]</td>
<td width="765" background="../styles/OrangeBlue/bottom_bg.gif"></td>
<td width="8">[img]../styles/OrangeBlue/bottom_right.gif[/img]</td>
</tr>
</table>
</td>
<td width="10"></td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>