Three ways to use the javascript confirmation box_Basic knowledge
May 16, 2016 pm 05:08 PMThe first method: It is very easy to use. Only after confirmation can the download address page be opened. The principle is also relatively clear. Mainly used to confirm deletion of a single message.
Copy code The code is as follows:
<SCRIPT LANGUAGE=javascript>
function del () {
var msg = "Are you really sure you want to delete it? nnPlease confirm!";
if (confirm(msg)==true){
return true;
}else{
return false;
}
}
</SCRIPT>
Calling method:
Copy code The code is as follows:
<a href=" del.php?id=123" onclick="javascript:return del()">Delete</a>
Second method: The principle is the same as above. JavaScript delete confirmation box
Copy code The code is as follows:
<a href="javascript: if(confirm('Are you sure you want to delete?'))location='jb51.php?id='">Delete</a>
The third type: confirmation prompt mainly used for batch deletion
Copy code The code is as follows:
<input name="Submit" type="submit" class="inputedit" value="Delete"
onclick="{if(confirm('Are you sure about the record?')){
this .document.formname.submit();
return true;}return false;
}">
<input name="Button" type="button" ID="ok" onclick=" {if(confirm('Are you sure to delete?')){
window.location='Action.asp?Action=Del&
TableName=Item&
ID=<%=ID%>';
return true;
}return false;}" value="Delete column" />
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Replace String Characters in JavaScript

Custom Google Search API Setup Tutorial

8 Stunning jQuery Page Layout Plugins
