2014-03-25 49 views
0

我在这里有一个表格,显示来自我的数据库的记录。它还会生成动态的复选框以及获取的记录。我需要做的是打开一个新窗口使用window.open,而不是页面去editor.php。任何帮助将很乐意欣赏。打开多个编辑记录的新窗口

的MySQLi查询

while ($row = $result1->fetch_assoc()) { 
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="' . $row['id'] . '"'.($row['pr'] == ""?"disabled ":"").' style="cursor:pointer;" class="checkbox"></td> 
} 

的Javascript

<script type="text/javascript" language="javascript"> 
function setCheckboxes3(act) { 
    $('.checkbox').not(':disabled').prop('checked', act == 1 ? true : false); 
    //or $('.checkbox:not(:disabled)').prop('checked', act == 1 ? true : false) 
} 
</script> 
<script> 
jQuery(function ($) { 
    $('a.button.edit, a.button.remove').click(function() { 
     if ($('input[name="checkbox[]"]:checked').length == 0) { 
      return; 
     } 

     if ($(this).hasClass('edit')) { 
      if (!confirm('Edit this Record(s)?')) { 
       return 
      } 
     } else { 
      if (!confirm('WARNING !!! All Purchase Order that included in this Record(s) will be deleted.')) { 
       return 
      } 
     } 

     var frm = document.myform; 
     if ($(this).hasClass('edit')) { 
      frm.action = 'editpr.php'; 
     } 
     if ($(this).hasClass('remove')) { 
       if (!confirm('Are you sure want to continue?')) { 
       return 
      } 
     } 
     frm.submit(); 
    }) 
}) 
</script> 

HTML

<a class="button edit" style="cursor:pointer;"><span><b>Edit</b></span></a> 
+0

您是否尝试过使用目标=“_空白”标签上的? –

+0

您也可以使用目标=“_ blank”在您的

回答

0

如果你的脚本是正确的只需添加您的形式

<form target="_blank" [....] 
+0

我试过了,但是我需要将它打开到像窗口框这样的新窗口中? – user3097736