English 中文(简体)
警示后重页[复制]
原标题:reloading page after the alert button [duplicate]

经批准后,警报电文将出现,有2个选项,即“k”和“cancel”。 在点击ok将重载后,问题在于我可以多加批准,因为在点击警钟之后,该网页将重载。

我尝试了浮标功能,但在一点击批准纽特之后,它仍然重新上载,同时试图消除警示(数据-公司),但该网页仍然重载。

采用这些代码:

<button type="submit" name="status" value="2" class="btn btn-success btn-sm m-b-0-0 waves-effect waves-light" data-confirm="Are you sure you want to approve this leave application?"  title="Approve">
    <i class="fa fa-check"></i>
</button>

它是纽芬兰的产物:

“纽扣吨产出”/

我如何能够在不出现警示的情况下多加批准,但仍记录数据?

在点击 check子之后,必须改变行车,如何做到这一点,而不必再上载或翻封页?

https://i.stack.imgur.com/FEqIX.png” rel=“nofollow noreferer”>。

这是整个图像法。

问题回答

为了在不发出警示和上下页的情况下获得多次核准,你可以使用 Java本处理表格的同步提交。

  1. change the button type to "button" instead of "submit" to prevent the form from being submitted automatically.
  2. add an event listener to the button which triggers when it s clicked.

经批准后,警报电文将出现,有2个选项,即“k”和“cancel”。

如果有<代码>Ok和Cancel, 请使用<代码>form要素。

当一个表格被压缩时,页面自动上载。

To prevent Page reload after Ok button is clicked, You should use preventDefault() method

html文档:

<form id="myForm">
    <!-- your other tags here -->
    <button type="reset" name="reset" >Cancel</button>
    <button type="submit" name="status" value="2" class="btn btn-success btn-sm m-b-0-0 waves-effect waves-light" data-confirm="Are you sure you want to approve this leave application?"  title="Approve">
    <i class="fa fa-check"></i>
   </button>
</form>

Javacast file:

document.addEventListener( DOMContentLoaded , function() {
    document.getElementById( myForm ).addEventListener( submit , function(event) {
        event.preventDefault();
        // Rest of Your form submission logic here
    });
});

if you want inline Javascript, place script tag inside a head tags

<head>
 <!-- your other tags here -->
<script>
document.addEventListener( DOMContentLoaded , function() {
    document.getElementById( myForm ).addEventListener( submit , function(event) {
        event.preventDefault();
        // Rest of Your form submission logic here
    });
});
</script>

</head>
<body>
 <!-- your other tags here -->
   <form id="myForm">
    <!-- your other tags here -->
    <button type="reset" name="reset" >Cancel</button>
    <button type="submit" name="status" value="2" class="btn btn-success btn-sm m-b-0-0 waves-effect waves-light" data-confirm="Are you sure you want to approve this leave application?"  title="Approve">
    <i class="fa fa-check"></i>
   </button>
  </form>
 <!-- your other tags here -->
</body>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签