Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making second set of radio buttons appear after checking first set

Status
Not open for further replies.

erinql

Programmer
Oct 19, 2001
13
0
0
US
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=&quot;#E6E6E6&quot;>
<b>Type</b>
</td>
<td bgcolor=&quot;#E6E6E6&quot;>
<? if ($users[type] == &quot;E&quot;) {
$check_E = &quot;checked&quot;;
}
elseif ($users[type] == &quot;M&quot;) {
$check_M = &quot;checked&quot;;
}
?>
<input tabindex=&quot;15&quot; name=&quot;type&quot; type=&quot;radio&quot; <? echo $check_E;?>>Employee <br/>
<input tabindex=&quot;16&quot; name=&quot;type&quot; type=&quot;radio&quot; <? echo $check_M;?>>Machine
</td>
</tr>
<tr>
<td>
<b>Status</b>
</td>
<td>
<? if ($users[status] == &quot;1&quot;) {
$check_1 = &quot;checked&quot;;
}
elseif ($users[status] == &quot;2&quot;) {
$check_2 = &quot;checked&quot;;
}
elseif ($users[status] == &quot;3&quot;) {
$check_3 = &quot;checked&quot;;
}
?>
<input tabindex=&quot;17&quot; name=&quot;status&quot; type=&quot;radio&quot; <? echo $check_1.'>'.$stat[1];?> <br/>
<input tabindex=&quot;18&quot; name=&quot;status&quot; type=&quot;radio&quot; <? echo $check_2.'>'.$stat[2];?> <br/>
<input tabindex=&quot;19&quot; name=&quot;status&quot; type=&quot;radio&quot; <? echo $check_3.'>'.$stat[3];?> <br/>
</td>
</tr>

Thanks!
Eman Erin Quick-Laughlin
DBA, PHP/MySQL programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top