Javascript 如何在覆盖中创建提交和关闭按钮
我正在寻找一个按钮,将提交,然后关闭一个覆盖窗口 我的按钮的代码是:Javascript 如何在覆盖中创建提交和关闭按钮,javascript,html,Javascript,Html,我正在寻找一个按钮,将提交,然后关闭一个覆盖窗口 我的按钮的代码是: <a href="javascript:additem('Info to add here', 10.00,1);" role="button"><button class="purchase btn btn-warning">Select</button></a> 做出选择后,我缺少什么来关闭按钮?不清楚您的问题。这是假设。也许会有帮助 function closeSelf(
<a href="javascript:additem('Info to add here', 10.00,1);" role="button"><button class="purchase btn btn-warning">Select</button></a>
做出选择后,我缺少什么来关闭按钮?不清楚您的问题。这是假设。也许会有帮助
function closeSelf(){
// do something
if(condition satisfied){
alert("conditions satisfied, submiting the form.");
document.forms['certform'].submit();
window.close();
}else{
alert("conditions not satisfied, returning to form");
} }
<input type="button" class="purchase btn btn-warning" value="Select" onclick="closeSelf();"/>
需要更多的上下文。。。我们不知道它们是如何编码的。什么是神秘的?您通常如何关闭覆盖层?为什么不合并它们呢?我无法合并,因为叠加上有多个按钮。代码仍然不清楚。你不会得到答案的。试试这个