Hi all!
I'm modifying an employee db, and it needs 2 new fields: Type & Status. When radio button 'type' (Employee/Machine) is chosen, I need Status to show up without going back to the server.
status(1/2/3) will have different text values according to type. (Either Hired/Active/Term or Off-line/On-line/Disposed)
So how do I make status show up with correct text, after type is chosen? Here's the current code (with some php in it):
<tr>
<td bgcolor="#E6E6E6">
<b>Type</b>
</td>
<td bgcolor="#E6E6E6">
<? if ($users[type] == "E"
{
$check_E = "checked";
}
elseif ($users[type] == "M"
{
$check_M = "checked";
}
?>
<input tabindex="15" name="type" type="radio" <? echo $check_E;?>>Employee <br/>
<input tabindex="16" name="type" type="radio" <? echo $check_M;?>>Machine
</td>
</tr>
<tr>
<td>
<b>Status</b>
</td>
<td>
<? if ($users[status] == "1"
{
$check_1 = "checked";
}
elseif ($users[status] == "2"
{
$check_2 = "checked";
}
elseif ($users[status] == "3"
{
$check_3 = "checked";
}
?>
<input tabindex="17" name="status" type="radio" <? echo $check_1.'>'.$stat[1];?> <br/>
<input tabindex="18" name="status" type="radio" <? echo $check_2.'>'.$stat[2];?> <br/>
<input tabindex="19" name="status" type="radio" <? echo $check_3.'>'.$stat[3];?> <br/>
</td>
</tr>
Thanks!
Eman Erin Quick-Laughlin
DBA, PHP/MySQL programmer
I'm modifying an employee db, and it needs 2 new fields: Type & Status. When radio button 'type' (Employee/Machine) is chosen, I need Status to show up without going back to the server.
status(1/2/3) will have different text values according to type. (Either Hired/Active/Term or Off-line/On-line/Disposed)
So how do I make status show up with correct text, after type is chosen? Here's the current code (with some php in it):
<tr>
<td bgcolor="#E6E6E6">
<b>Type</b>
</td>
<td bgcolor="#E6E6E6">
<? if ($users[type] == "E"
$check_E = "checked";
}
elseif ($users[type] == "M"
$check_M = "checked";
}
?>
<input tabindex="15" name="type" type="radio" <? echo $check_E;?>>Employee <br/>
<input tabindex="16" name="type" type="radio" <? echo $check_M;?>>Machine
</td>
</tr>
<tr>
<td>
<b>Status</b>
</td>
<td>
<? if ($users[status] == "1"
$check_1 = "checked";
}
elseif ($users[status] == "2"
$check_2 = "checked";
}
elseif ($users[status] == "3"
$check_3 = "checked";
}
?>
<input tabindex="17" name="status" type="radio" <? echo $check_1.'>'.$stat[1];?> <br/>
<input tabindex="18" name="status" type="radio" <? echo $check_2.'>'.$stat[2];?> <br/>
<input tabindex="19" name="status" type="radio" <? echo $check_3.'>'.$stat[3];?> <br/>
</td>
</tr>
Thanks!
Eman Erin Quick-Laughlin
DBA, PHP/MySQL programmer