I am developing a web application but problem is users are using PCs with windows OS and IE browsers.
Running in Opera it works fine.
The codes:
<?php
require_once('dakwa_fns.php');
do_html_header(':: LOG MASUK');
$value = "";
if ( isset( $_POST[ 'kod_bahagian' ] ) ) {
$value = $_POST[ 'kod_bahagian' ];
}
?>
<script language="JavaScript">
function resubmit()
{
document.myform.action="select_user.php";
document.myform.submit();
}
function process()
{
document.myform.action="check_user.php";
document.myform.submit();
}
</script>
<table width="770" border="0">
<tr>
<td width="200" valign="top" class="style1"> </td>
<td width="560">
<p><span class="style1"><strong>PILLIH BAHAGIAN DAN NAMA PENGGUNA:</strong></span></p>
<form name="myform" method="post" >
<input type="hidden" name="action" value="select_user" />
<table width="550" border="0">
<tr>
<td width="200">Pilih Bahagian: </td>
<td width="340">
<select class="txt" name="kod_bahagian" onchange="resubmit()">
<?php
$user_array=get_bahagian();
foreach ($user_array as $thisbhg)
{
echo '<option value="';
echo $thisbhg['kod_bahagian'];
echo '"';
if ($thisbhg['kod_bahagian'] == $value) {
echo ' selected';
$selected_bhg = $thisbhg['kod_bahagian'];
} else {
$init_bhg = $thisbhg['kod_bahagian'];
}
echo '>';
echo $thisbhg['nama_bahagian'];
echo "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td width="200">Pilih Nama Pengguna: </td>
<td width="340">
<select name="nama_login" class="txt" size="1">
<option value="">Pilih Nama ........</option>
<?php
if ($value == "")
{
$user_array=get_users($init_bhg);
} else {
$user_array=get_users($selected_bhg);
}
if (!empty($user_array)) {
foreach ($user_array as $thisuser)
{
echo '<option value="';
echo $thisuser['nama_login'];
echo '"';
echo '>';
echo $thisuser['nama_penuh'];
echo "\n";
$usertype = $thisuser['user_type'];
}
}
?>
</select>
</td>
</tr>
<tr>
<td width="200">Katalaluan:</td>
<td width="340">
<input type="password" name="kata_laluan" class="txt" maxlength="20" /></td>
</tr>
<tr>
<td width="200"> </td>
<td width="340"> </td>
</tr>
</table>
<input type="hidden" name="user_type" value="<?php if (isset($usertype)) echo $usertype; ?>">
<input type="button" class="btn" name="check_user" value="Log Masuk" onclick="process()" />
<input type="reset" class="btn" name="reset" value="Isi Semula" />
</form>
</td>
</tr>
</table>
<?php
do_html_footer();
?>
Problem:
The first SELECT does not populated (on some PCs)
When user select the first SELECT form didnot resubmit ( IE error: Object doesnt support this property or method)
Can someone inform me what is wrong with the above codes.