선택삭제 도움좀 부탁드립니다 채택완료
http://sir.kr/data/editor/1610/0cf3351be4bf7a24e77ce510b35ed973_1475301020_9302.png" title="0cf3351be4bf7a24e77ce510b35ed973_1475301020_9302.png" alt="0cf3351be4bf7a24e77ce510b35ed973_1475301020_9302.png" width="564" style="margin: 0px; padding: 0px; border: 0px; vertical-align: middle; max-width: 100%; height: auto;">
스크랩 선택삭제 버튼을 만들고 싶은데요
선택삭제 버튼이 전혀 반응을 하지 않아요
소스가 많이 틀린것 같은데
단번에 안되겠지만
선택삭제 버튼이 반응을 하려면
어디를 어떻게 해야될까여?
도움좀 부탁드립니다
</strong><span style="font-size: 11pt;"> <th scope="col"></span></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <label for="all_chk" class="sound_only">목록 전체</label></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <input type="checkbox" id="all_chk"></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> </th><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 15px;">
</strong><span style="font-size: 11pt;"><td class="td_chk"></span></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <label for="chk_bn_id_<?php echo $i; ?>" class="sound_only"><?php echo $num?>번</label></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <input type="checkbox" name="chk_bn_id[]" value="<?php echo $i; ?>" id="chk_bn_id_<?php echo $i; ?>"></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <input type="hidden" name="bo_table[<?php echo $i; ?>]" value="<?php echo $list[$i]['bo_table']; ?>"></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> <input type="hidden" name="wr_id[<?php echo $i; ?>]" value="<?php echo $list[$i]['wr_id']; ?>"></p><p style="word-break: break-all; background-color: rgb(255, 255, 255); font-size: 14.6667px;"> </td></p><div style="background-color: rgb(255, 255, 255); font-size: 14.6667px;"><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 15px;">
</strong><span style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 15px;">
</span></div><div style="background-color: rgb(255, 255, 255);"><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"><div class="sir_bw02 sir_bw"></span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> <input type="submit" onclick="document.pressed=this.value" value="선택삭제" class="btn_submit"> </span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> </div></span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"><script></span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">$(function(){</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> $('#all_chk').click(function(){</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> $('[name="chk_bn_id[]"]').attr('checked', this.checked);</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> });</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">});</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">function fnew_submit(f)</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">{</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> f.pressed.value = document.pressed;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> var cnt = 0;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> for (var i=0; i<f.length; i++) {</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> if (f.elements[i].name == "chk_bn_id[]" && f.elements[i].checked)</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> cnt++;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> }</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> if (!cnt) {</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> alert(document.pressed+"할 게시물을 하나 이상 선택하세요.");</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> return false;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> }</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> if (!confirm("선택한 게시물을 정말 "+document.pressed+" 하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다")) {</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> return false;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> }</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">
</span></font></div><div><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> f.action = "./scrap_delete.php";</span></font>
</div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"> return true;</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;">}</span></font></div><div style="font-size: 14.6667px;"><font color="#7f7f7f" face="돋움, Dotum, sans-serif"><span style="font-size: 15px;"></script> </span></font><strong style="color: rgb(127, 127, 127); font-family: 돋움, Dotum, sans-serif; font-size: 15px;">
답변 3개
</p><p><form method="post" onsubmit="return fnew_submit(this);"></p><p><input type="hidden" name="pressed" value=""></p><p><table></p><p> <tr></p><p> <th scope="col"></p><p> <label for="all_chk" class="sound_only">목록 전체</label></p><p> <input type="checkbox" id="all_chk"></p><p> </th></p><p></tr></p><p><tr></p><p> <td class="td_chk"></p><p> <label for="chk_bn_id_<?php echo $i; ?>" class="sound_only"><?php echo $num?>번</label></p><p> <input type="checkbox" name="chk_bn_id[]" value="<?php echo $i; ?>" id="chk_bn_id_<?php echo $i; ?>"></p><p> <input type="hidden" name="bo_table[<?php echo $i; ?>]" value="<?php echo $list[$i]['bo_table']; ?>"></p><p> <input type="hidden" name="wr_id[<?php echo $i; ?>]" value="<?php echo $list[$i]['wr_id']; ?>"></p><p> </td></p><p></tr></p><p></table></p><p> </p><p><div class="sir_bw02 sir_bw"></p><p> <input type="submit" name="submit_button" value="선택삭제" class="btn_submit"> </p><p></div></p><p></form></p><p> </p><p><script></p><p>$(function(){</p><p> $('#all_chk').click(function(){</p><p> $('[name="chk_bn_id[]"]').attr('checked', this.checked);</p><p> });</p><p>});</p><p> </p><p>function fnew_submit(f)</p><p>{</p><p> document.pressed = f.submit_button.value; </p><p> f.pressed.value = document.pressed;</p><p> </p><p> var cnt = 0;</p><p> for (var i=0; i<f.length; i++) {</p><p> if (f.elements[i].name == "chk_bn_id[]" && f.elements[i].checked)</p><p> cnt++;</p><p> }</p><p> </p><p> if (!cnt) {</p><p> alert(document.pressed+"할 게시물을 하나 이상 선택하세요.");</p><p> return false;</p><p> }</p><p> </p><p> if (!confirm("선택한 게시물을 정말 "+document.pressed+" 하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다")) {</p><p> return false;</p><p> }</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre"> </span>f.action = "./scrap_delete.php";</p><p><span class="Apple-tab-span" style="white-space:pre"> </span>return true;</p><p>}</p><p></script></p><p>
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인