<!--- 전송할 페이지 (목록페이지 ) ---> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=euc-kr" /> <title>무제 문서</title> <script type="text/javascript"> <!-- function checkForm(frm){
var chkbox = frm['chkbox[]']; var cnt = 0;
for (var i = 0 ; i < chkbox.length; i++) { if (chkbox[i].checked) { cnt++; } }
if(cnt == 0){ window.alert("체크박스 좀 선택해봐!"); return; }
document.frmList.action = "checkbox_ok.php"; document.frmList.submit(); } //--> </script> </head> <body> <form name="frmList" method="POST" action="javascript:checkForm(document.frmList);"> <table width="390" border="1"> <tr> <td width="40" align="center"> 선택</td> <td width="50" align="center"> 번호</td> <td width="200" align="center"> 이름</td> </tr> <?php
$robot_name = array( "기둥전사 곤담", "마징과Z", "로보트택견V", "현대그랜다이져", "찡가", "독수리6형제" );
for($i=0; $i<6; $i++){?> <tr> <td> <input type="checkbox" name="chkbox[]" value="<?=$i?>" /></td> <td width="50" align="right"> <?=$i?></td> <td width="200"> <input type="hidden" name="rname[]" value="<?=$robot_name[$i]?>"/><?=$robot_name[$i]?></td> </tr> <?php }?> <tr> <td colspan="5" align="right"><input type="submit" name="Submit" value="전송" /></td> </tr> </table> </form> </body> </html> |