我有一个通过PHP代码生成的ListView:
<?php do { ?>
<tr>
<td width="20"><a href="edit_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>"> <img src="./images/small_pencil.png" /></a></td>
<td width="20"><a href="view_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>"> <img src="./images/small_eye2.png" /></a></td>
<td width="20">
<form name="properties" method="post" action="properties.php?search=<?php echo $row_rsProperties['ms_address']; ?>">
<button type="submit" name="properties"> <img src="./images/newsletter.png" /> </button>
</form>
</td>
<td width="250"><?php echo $row_rsProperties['ms_address']; ?></td>
<td width="140"><?php echo $row_rsProperties['ms_city']; ?></td>
<td width="140"><?php echo $row_rsProperties['ms_state']; ?></td>
<td width="60" align="center"><?php echo $row_rsProperties['ms_zip']; ?></td>
<td width="250"><?php echo $row_rsProperties['ms_mm_owner1']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['owner_phone1']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['expired']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['fsbo']; ?></td>
<td width="250" align="center"><?php echo $row_rsProperties['ms_status']; ?></td>
</tr>
<?php } while ($row_rsProperties = mysql_fetch_assoc($rsProperties)); ?>
如何在窗口中打开编辑或查看锚点击(在验证后通过javascript代码打开?
PHP文件(在加载主菜单时执行):
<body onLoad="openDetailWindow()">
Javascript src .js文件功能:
function openDetailWindow() {
window.open("_blank.php","LMS - Record Detail","fullscreen=0,menubar=0","false");
}
答案 0 :(得分:0)
将以下代码放在锚标记内:
onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"
所以,现在标签现在如下所示:
<td width="20"><a href="edit_property_mktg.php?recID=<?php echo $row_rsProperties['recID']; ?>" onclick="window.open(this.href, 'LMS - Record Detail',
'menubar=0,scrollbars=1,toolbar=0', 'false'); return false;"> <img src="./images/small_pencil.png" /></a></td>