我有一个链接,我首先需要检查用户是否具有删除权限,然后在提交之前在删除链接上进行确认,除取消之外的所有操作均有效,这将继续执行删除操作
function validate2() {
if (1 == 1) // this will be a dynamic value when working
{
var delyes = confirm('Are you sure you want to delete this work order\nClick ok to Delete or Cancel to return to the page\nTHIS CAN NOT BE REVERSED'); // prompt user
if (delyes == true)
{
return true;
} else {
return false;
}
} else {
alert('no chance')
return false;
}
}
我这样打电话
<a onclick="return validate2();" id="DeleteLink"class="tab1" href="
唯一不起作用的是确认框中的取消按钮