Nieuw lid |
|
Hoi,
ik heb een stukje script waarin je dmv een knop alle checkboxen aanvinkt. Nu weet ik alleen niet hoe ik dit dan moet deleten.
Dit is het script:
<script language="JavaScript">
var checkflag="false";
function check(field){
if(checkflag=="false"){
for(i=0;i<field.length;i++){
field[i].checked=true;
}
checkflag="true";
return "Uncheck All messages";
}
else{
for(i=0;i<field.length;i++){
field[i].checked=false;
}
checkflag="false";
return "Check all messages";
}
}
</script>
<?
$messages_query = MySql_Query("SELECT * FROM `messages` WHERE `to` = '".$user['username']."' ORDER BY `id` DESC LIMIT 10");
if(MySql_Num_Rows($messages_query) == 0){
?>
<center>
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=40%>
<tr>
<td class="topheader">Mailbox</td>
</tr>
<tr>
<td>Sorry boss, nobody left you any message. Try it again later.</td>
</tr>
</table>
</center>
<?
}
else{
?>
<center>
<form action="?item=mailbox" name="MailboxFrm">
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=40%>
<tr>
<td class="topheader">Mailbox</td>
</tr>
<tr>
<td align="center"><input type="button" name="btnCheck" onClick="this.value=check(this.form.chkDelete)" value="Check all messages"> <input type="submit" name="btnDelete" value="Delete"></td>
</tr>
</table>
<br><br>
<?
while($pm = MySql_Fetch_Assoc($messages_query)){
if($pm['from'] == 'Notification'){ $author = "Notification"; }
else{ $authors = MySql_Fetch_Assoc(MySql_Query("SELECT * FROM `users` WHERE `username` = '".$pm['from']."'")); $author = "<a href=\"?item=viewprofile&uid=".$authors['id']."\">".$authors['username']."</a>"; }
?>
<table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<tr>
<td class="topheader">From: <?=$author; ?> on <?=$pm['date']; ?></td>
</tr>
<tr>
<td><?=ubb($pm['message']); ?></td>
</tr>
<tr>
<td><input type="checkbox" name="chkDelete" value="<?=$pm['id']; ?>"> <input type="submit" name="btnReply" value="Reply"> <input type="submit" name="btnSave" value="Save"></td>
</tr>
</table>
<br><br>
<?
}
?>
</form>
</center>
<?
}
?>
<script language="JavaScript"> var checkflag="false"; function check(field){ if(checkflag=="false"){ for(i=0;i<field.length;i++){ field[i].checked=true; } checkflag="true"; return "Uncheck All messages"; } else{ for(i=0;i<field.length;i++){ field[i].checked=false; } checkflag="false"; return "Check all messages"; } } </script> <? $messages_query = MySql_Query("SELECT * FROM `messages` WHERE `to` = '".$user['username']."' ORDER BY `id` DESC LIMIT 10"); ?> <center> <table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=40%> <tr> <td class="topheader">Mailbox</td> </tr> <tr> <td>Sorry boss, nobody left you any message. Try it again later.</td> </tr> </table> </center> <? } else{ ?> <center> <form action="?item=mailbox" name="MailboxFrm"> <table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=40%> <tr> <td class="topheader">Mailbox</td> </tr> <tr> <td align="center"><input type="button" name="btnCheck" onClick="this.value=check(this.form.chkDelete)" value="Check all messages"> <input type="submit" name="btnDelete" value="Delete"></td> </tr> </table> <br><br> <? if($pm['from'] == 'Notification'){ $author = "Notification"; } else{ $authors = MySql_Fetch_Assoc(MySql_Query("SELECT * FROM `users` WHERE `username` = '".$pm['from']."'")); $author = "<a href=\"?item=viewprofile&uid=".$authors['id']."\">".$authors['username']."</a>"; } ?> <table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%> <tr> <td class="topheader">From: <?=$author; ?> on <?=$pm['date']; ?></td> </tr> <tr> <td><?=ubb($pm['message']); ?></td> </tr> <tr> <td><input type="checkbox" name="chkDelete" value="<?=$pm['id']; ?>"> <input type="submit" name="btnReply" value="Reply"> <input type="submit" name="btnSave" value="Save"></td> </tr> </table> <br><br> <? } ?> </form> </center> <? } ?>
Ik hoop dat iemand een uitkomst weet
|