Not sure if this is the right place to post this?
The following page works with IExplorer and Chrome, but not with Firefox.
User is to select exactly 7 drivers, but with Firefox, no matter how many drivers you select, even seven, you get the popup stating you must select 7 drivers.
Can anyone see what I have done wrong here?
Thanx.
<?php
$tpl = new template;
$tpl -> Load("!theme/{$GLOBALS["THEME"]}/templates/fantasy/fselteam.tpl");
$tpl -> GetObjects();
if (isset($_SESSION["id"])) $tpl->Zone("userStatus", "user");
else $tpl->Zone("userStatus", "guest");
if (isset($GLOBALS["LOGIN_FAIL_TYPE"])) {
if ($GLOBALS["LOGIN_FAIL_TYPE"] == "e.password") $loginError = $GLOBALS["OBJ"]["loginError.password"];
elseif ($GLOBALS["LOGIN_FAIL_TYPE"] == "e.user") $loginError = $GLOBALS["OBJ"]["loginError.username"];
elseif ($GLOBALS["LOGIN_FAIL_TYPE"] == "e.bruteforce") $loginError = $GLOBALS["OBJ"]["loginError.bruteforce"];
elseif ($GLOBALS["LOGIN_FAIL_TYPE"] == "e.active") $loginError = $GLOBALS["OBJ"]["loginError.active"];
}
$tpl -> AssignArray(array(
"login.failMessage" => (isset($loginError)?$loginError:NULL)
));
// Report all PHP errors (see changelog)
// error_reporting(E_ALL);
include_once('db_conn.php');
$sql = "SELECT * FROM `nascar_standings` ORDER BY driver ASC LIMIT 65";
$rs = mysql_query($sql);
$user = "frank";
$i = 0;
$sel_text = "";
$column = "</tr><tr>";
$sel_text .= "<form name='frmChk' action='testsel1.php' method='post'>";
while($row = mysql_fetch_assoc($rs)){
$label = $row['driver'];
$sel_text .= "<td><input type='checkbox' name='chks[]'> $label </td>";
if (++$i % 4 == 0)
{
$sel_text .= $column;
}
}
$sel_text .= "</tr><tr><td colspan =4 valign = center><input type='submit' value='Validate & Submit' name='validate' onclick='if(!checkCount()) return false;'></form></td></tr></table>";
$sel_text .= "<script language='javascript'>
function checkCount(){
var count=0;
var inputs=document.frmChk.getElementsByTagName('input');
for(var i=0; i<inputs.length-1; i++){
if(inputs[i].type == 'checkbox' && inputs[i].checked == true)
count++;
}
if(count != 7){
alert('You must select 7 Drivers');
return false;
}
return true;
}
</script>";
$tpl -> AssignArray(array('selteam' => $sel_text));
$tpl -> Flush();
?>