Checkebox doesn't hold its value when i use jQuery styling plugin wich allows me to skin form elements. but when i remove the jQuery the code works !!
can someone plz tell me the way to fix it ?!
Code:
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"/>
<title> Delete Review </title>
<link rel="stylesheet" href="jqtransformplugin/jqtransform.css" type="text/css" media="all" />
<link rel="stylesheet" href="demo.css" type="text/css" media="all" />
<!-- Script for the event handeler -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.colorize-2.0.0.js"></script>
<script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js" ></script>
<script language="javascript">
$(document).ready(function(){
$('form').jqTransform({imgPath:'jqtransformplugin/img/'});
});
</script>
<script>
$(document).ready(function(){
$("#review").colorize( );
});
</script>
</head>
<body>
<form action="" method="post" class = "first" >
<p align="center"> Welcome to Delete Review Page <br/>Please seclect what you want to delete </p>
<p>
<table align="center" width="400" border="0" cellspacing="1" cellpadding="0">
<tr background: rgb(236, 246, 252) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;>
<td><form action="" method="post" class = "second">
<table id = "review" width="400" border="0" cellpadding="3" cellspacing="1">
<tr >
<td > </td>
<td colspan="4" align="center" ><strong>Delete Reviews</strong> </td>
</tr>
<tr>
<td align="center" ></td>
<td align="center" ><strong>Shop Name</strong></td>
<td align="center" ><strong>Review</strong></td>
</tr>
<?php
// Connects to Database
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("phase2") or die(mysql_error());
$query = mysql_query("SELECT beautyshops.shopID, shopName,reviewID, reviews.shopID, review
FROM beautyshops,reviews WHERE reviews.shopID = beautyshops.shopID ") or die(mysql_error());
while ($row = mysql_fetch_array($query))
{
$SID = $row[beautyshops.shopID];
$SName = $row[shopName];
?>
<tr>
<td align="center" ><input name="checkbox[]" type="checkbox" id="checkbox" value="<?php echo $row['reviewID']; ?>"/></td>
<td align="center" ><strong><?php echo $SName; ?></strong></td>
<td align="center"><?php echo $row['review']; ?></td>
</tr>
<?php
}
?>
</table>
</form>
</table>
<p align = "center"><input name="delete" type="submit" id="delete" value="Delete"/></p>
<?php
// Check if delete button active, start this
if($_POST['delete']){
//print($_POST);
$checkbox=$_POST['checkbox'];
//exit;
for($i=0;$i<count($checkbox);$i++)
{
$del_id = $checkbox[$i];
$result = mysql_query("DELETE FROM reviews WHERE reviewID = '$del_id'");
}
// if successful redirect to delete Reviwe.php
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=test.php\">";
}
}
mysql_close();
?>
</body>
</html>