3
I have a button in ASP.NET webForm and even clicking cancel it sends the Submit.
Example in Fiddle
http://jsfiddle.net/dorathoto/qywvuhvq/
$(function () {
$("[name='chk_IDDel']").change(function () {
var disabled = true;
$("[name='chk_IDDel']").each(function () {
if ($(this).is(':checked')) {
disabled = false;
if ($("input[name=chk_IDDel]:checked").length > 1) {
document.getElementById("<%= btn_Deletar.ClientID%>").value = 'Deletar imóveis';
}
else {
document.getElementById("<%= btn_Deletar.ClientID%>").value = 'Deletar imóvel'
}
}
});
$('#<%= btn_Deletar.ClientID%>').prop("disabled", disabled);
});
$("#<%= btn_Deletar.ClientID%>").click(function () {
var confirma = prompt("digite a palavra 'confirmar' para deletar", "");
if (confirma.toUpperCase() == "CONFIRMAR") {
document.all.submit();
}
else {
return false;
}
});
});
What am I doing wrong in JQUERY? I don’t want you to send when clicking cancel.. or not typing.
for some reason it is working, but has stopped the functionality of ASP:Button (not running the code)
– Dorathoto
I removed e.preventDefault(); that problem in Webform and it worked http://jsfiddle.net/dorathoto/qywvuhvq/1/
– Dorathoto