The short script doesn't work at Chrome but work at Firefox.
<p>This is a js script checkbox to select all dates. It works at Firefox but not at Chrome. </p>

<pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
function toggle(source) {
      checkboxes = document.getElementsByName('check_time[]');
      for each(var checkbox in checkboxes)
        checkbox.checked = source.checked;
    }
&lt;/script&gt;

&lt;?php
session_start();
include ("include/dbconnect.php");
$timestamp = mysql_real_escape_string(strtotime($_POST['date']));
$doc_username = $_SESSION['username'];
$date = @ strip_tags (date("Y-m-d",$timestamp));

$timezone ="Asia/Kuala_Lumpur";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
    $todaydate = date("Y-m-d");

if($date == '')
{
  echo "&lt;i&gt;Please select a date&lt;/i&gt;";
}else if ($date &lt; $todaydate)
{   
  echo "&lt;i&gt;* You are not allowed to choose date before $todaydate&lt;/i&gt;";

}else
{
$inc   = 1800;
$start = (strtotime('0830')); // 9 AM
$end   = (strtotime('1630')); // 5 PM
echo "&lt;b&gt;*Pick if the time is not available&lt;/b&gt;&lt;br&gt; &lt;br&gt;";
echo "&lt;form action='doc_confirmtime.php' method='POST'&gt;";
echo "&lt;input type='checkbox' onClick='toggle(this)' /&gt;Select All&lt;br/&gt;";
for( $i = $start; $i &lt;= $end; $i += $inc )
{   
    $timeslot = date( 'G:i:s ', $i + $inc );// to the standart format
    $query = mysql_query("SELECT * from appointment Limit 1");

    while($row = mysql_fetch_array($query))
    {
        $date2 = $row['date'];
        $time = $row['time'];

        $query2 = mysql_query("SELECT doc_username, date, time, status from appointment WHERE (doc_username = '$doc_username' AND date = '$date' AND time = '$timeslot') AND (status = '0' OR status = '1' OR status = '2' OR status is NULL)");
        $result = mysql_fetch_array($query2,0);

        if ($result &gt; 0)
        {
            echo "&lt;font size='+1' face='Tahoma, Geneva, sans-serif'&gt;&lt;input type='checkbox' name='check_time[]' value='$timeslot' checked = 'checked' DISABLED&gt;&lt;b&gt;$timeslot&lt;/b&gt;&lt;/font&gt;&lt;br&gt;";
        }else
        {
            echo "&lt;font face='Arial, Helvetica, sans-serif'&gt;&lt;input type='checkbox' name='check_time[]' value='$timeslot'&gt;$timeslot&lt;/font&gt;&lt;br&gt;";
        }


    }
}
echo "&lt;i&gt;*Highlighted Time has chosen by you or your patient&lt;/i&gt;";
echo "&lt;br&gt;&lt;br&gt;";
echo "&lt;input type='submit' name='submit' value='Submit' style='width:60px; height=30px' /&gt;";
echo "&lt;input type='hidden' name='Date' value='$date' &gt;";
echo "&lt;/form&gt;";


}
mysql_close($connect);
?&gt;
</code></pre>

<p>This is actually a php that run by a JQuery AJAX html page. When submit button is enter, a list of dates(Checkbox) and a "select all" checkbox is shown. Firefox definitely can work but not at Chrome.</p>
