html checkboxes not working in Internet Explorer...
Posted: Fri Dec 01, 2006 11:50 am
i've got a cms that i'm designing for a client. there is a page that i have that retrieves all the results in a certain SQL table, and spits it out into an HTML table. at the end of each row in the HTML table, there is a delete checkbox... and a delete button at the bottom of the table...
it works great, for me... but i run firefox. when it is opened up in internet explorer... the checkbox doesn't work... where does this problem stem from??? here's the code...
need a little help here.
it works great, for me... but i run firefox. when it is opened up in internet explorer... the checkbox doesn't work... where does this problem stem from??? here's the code...
Code: Select all
<?php
@ $db = mysql_connect("yah", "blah", "blah");
mysql_select_db("my_DB", $db);
if(!$db){
echo "Error: Could not connect to the database. Please try again later.";
exit;
}
if($action == "simplesearch"){
trim($lname);
trim($fname);
if (!$lname){
echo "<FONT COLOR=FF0000>You have not filled the required fields. Please try again.</FONT>";
exit;
}
$result = mysql_query("SELECT * FROM my_search_table
WHERE brideLname LIKE '%". $lname ."%' OR groomLname LIKE '%". $lname ."%'
AND event_month ='". $event_month ."'
AND event_day = '". $event_day ."'
AND event_year = '". $event_year ."'")
or die(mysql_error());
}
elseif($action == "view_all"){
$v_a = "Viewing all entries.";
$_POST['delete'];
if($_POST['delete'] != NULL){
foreach($_POST['delete'] as $k => $c){
$sql = "DELETE FROM my_search_table WHERE uID = '". $c ."'";
mysql_query($sql) OR die ("The query:<br>" . $sql . "<br>Caused the following error:<br>" . mysql_error());
$reg = "DELETE FROM my_reg_table WHERE uID = '". $c ."'";
mysql_query($reg) OR die (mysql_error());
}
}
$result = mysql_query("SELECT * FROM my_search_table ORDER BY brideLname") or die(mysql_error());
}
$num_result = mysql_num_rows($result);
if($num_result < 1){
echo "Your search results for:<br />";
echo "First name: ". $fname ." | Last name: ". $lname .
" | Event Date: ". $event_month ."/". $event_day ."/". $event_day ."<br />";
echo "Number of matches: ". $num_result ."<br />";
echo "<FONT COLOR=\"red\">Sorry, there were no matches for your query. Please try again.</FONT><br />";
echo "<form action=\"addCouple.php\" method\"=post\"><input type=\"submit\" value=\"Add Newlywed\"></form><br />";
mysql_close($db);
exit;
}
else{
if(isset($v_a)){
echo $v_a ."<br />";
echo "Number of matches: ". $num_result ."<br />";
}
else{
echo "Your search results for:<br />";
echo "First name: ". $fname ." | Last name: ". $lname .
" | Event Date: ". $event_month ."/". $event_day ."/". $event_day ."<br />";
echo "Number of matches: ". $num_result ."<br />";
}
echo "<form action=\"addCouple.php\"><input type=\"submit\" value=\"Add\"></form><br />";
echo "<form action=\"admin1.php?action=view_all\" method=\"post\">";
echo "<TABLE WIDTH=\"750\" BORDER=\"1\" CELLPADDING=\"2\">";
echo "<form action=\"". $_SERVER['PHP_SELF'] ."?action=view_all\" method=\"post\">";
echo "<TR><TH>Bride</TH><TH>Groom</TH><TH>Event Date</TH><TH>Shipping Address</TH><TH>Edit</TH><TH>Delete</TH></TR>";
for($i=0; $i < $num_result; $i++){
$row = mysql_fetch_array($result);
echo "<TR><TD align=\"center\">". $row['brideFname'] ." ". $row['brideLname'] ."</TD><TD align=\"center\">". $row['groomFname'] ." ".
$row['groomLname'] ."</TD><TD align=center>". $row['event_month'] ."/". $row['event_day'] ."/". $row['event_year'] .
"</TD><TD align=\"center\">". $row['ship_add'] .", ". $row['ship_city'] .", ". $row['ship_state'] .", ". $row['ship_zip']
."</TD><TD align=\"center\" width=\"125\"><A HREF=\"editCouple.php?editID=". $row['uID'] ."\">Couple</A> / <A HREF=\"updateRegistry.php?regID=".
$row['uID'] ."\">Registry</A></TD><TD align=\"center\"><input type=\"checkbox\" name=\"delete[]\" value=\"". $row['uID'] ."\"></TD></TR>";
$_POST['editID'];
$_POST['regID'];
}
echo "</form></TABLE>";
echo "<p align\"=\"right><input type=\"submit\" value=\"Delete\">";
}
echo "</form></form></p>";
mysql_close($db);
?>