In my jQuery am displaying my results in a table formatted output, a part of my jQuery is
-
Simply works as:
$("a. close").live("click",function(event){
return confirm("Do you want to delete?");
});
讨论(0)
-
I used this:
<a href="url/to/delete.asp" onclick="return confirm(' you want to delete?');">Delete</a>
讨论(0)
-
function deleteItem(this) {
if (confirm("Are you sure?")) {
$(this).remove();
}
return false;
}
You can also use jquery modalin same way
JQuery version
Are you sure?
$(document).ready(function() {
$("#dialog-box").dialog({
autoOpen: false,
modal: true
});
$(".close").click(function(e) {
var currentElem = $(this);
$("#dialog-box").dialog({
buttons : {
"Confirm" : function() {
currentElem.remove()
},
"Cancel" : function() {
$(this).dialog("close");
}
}
});
$("#dialog-box").dialog("open");
});
});
讨论(0)
-
Try with below code:
$('.close').click(function(){
var checkstr = confirm('are you sure you want to delete this?');
if(checkstr == true){
// do your code
}else{
return false;
}
});
OR
function deleteItem(){
var checkstr = confirm('are you sure you want to delete this?');
if(checkstr == true){
// do your code
}else{
return false;
}
}
This may work for you..
Thanks.
讨论(0)
-
$(document).ready(function(){
$(".del").click(function(){
if (!confirm("Do you want to delete")){
return false;
}
});
});
讨论(0)
-
Try this my friend
// Confirmation Message On Delete Button.
$('.close').click(function() {
return confirm('Are You Sure ?')
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<td class='close'></td>
讨论(0)
- 热议问题