打开多个编辑记录的新窗口

时间:2014-03-25 06:09:48

标签: php jquery mysql

我这里有一个显示数据库记录的表格。它还会生成动态复选框以及提取的记录。我需要做的是使用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 个答案:

没有答案