<?
if ( $_POST['sel'] != '' ) {
$Sel[$_POST['sel']] = 'selected';
}
for( $i = 1; $i <= 3; $i++ ) {
if ( $_POST['chk' . $i] == '1' ) {
$Chk[$i] = 'checked';
}
}
for( $i = 1; $i <= 3; $i++ ) {
if ( $_POST['rd'] == $i ) {
$Rd[$i] = 'checked';
}
}
?>
<FORM name=frm method=post>
<SELECT name=sel>
<OPTION>
<OPTION value=1 <?=$Sel[1]?>>AAA
<OPTION value=2 <?=$Sel[2]?>>BBB
<OPTION value=3 <?=$Sel[3]?>>CCC
</SELECT>
<INPUT type=checkbox name=chk1 value=1 <?=$Chk[1]?>>
<INPUT type=checkbox name=chk2 value=1 <?=$Chk[2]?>>
<INPUT type=checkbox name=chk3 value=1 <?=$Chk[3]?>>
<INPUT type=radio name=rd value=1 <?=$Rd[1]?>>
<INPUT type=radio name=rd value=2 <?=$Rd[2]?>>
<INPUT type=radio name=rd value=3 <?=$Rd[3]?>>
<INPUT type=submit value="送信">
</FORM>
<PRE>
<?
print_r($_POST);
?>
</PRE>
|