如何在覆盖层中创建提交和关闭按钮

How to create a submit and close button in an overlay

本文关键字:创建 提交 关闭按钮 覆盖      更新时间:2023-09-26

我正在寻找一个按钮,将提交,然后关闭覆盖窗口。

我的按钮代码是:

<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();"/>