【发布时间】:2019-01-07 18:39:36
【问题描述】:
return confirm('Changing the protocol will reset the project Team members');
}
我在onclick上调用了两个方法,第一个是停止多次单击按钮,第二个是显示确认框。一旦用户点击取消,用户将无法再次保存。我正在寻找在点击时区分这两种肉类的解决方案。
<apex:commandButton onclick=" this.onclick=function(){return false;}; return showProtocolEditWarning();" action="{!save}" value="Save" id="commandButtonSave"/>
function showProtocolEditWarning(){
if(projectId && praProtocol){
var newProject = document.querySelector('input[id$="inputFieldPraProject_lkid"]').value;
var protocolIdElement = document.querySelector('select[id$="protocolIdList"]');
var newProtocol = protocolIdElement.options[protocolIdElement.selectedIndex].value;
if(praProject.substring(0,15) != newProject.substring(0,15) || praProtocol != newProtocol){
return confirm('Changing the protocol will reset the project Team members');
//window.location.reload() ;
}
}
return true;
}
【问题讨论】:
-
使用
location.reload()刷新页面。 -
你有什么问题?
标签: javascript visualforce confirm