i’m new to js. I have a lil problem,i have 2 functions , one to delete data and one to refresh the page
function btndeleteClick(){
var btn = $get("<%=btndeleteall.ClientID %>");
btn.click();
return true;
}
function RefreshPage() {
if (confirm('Anda akan menghapus Material yang belum terpakai')==true){
btndeleteClick();
window.location.reload();
} else {
return false;
}
}
the things is when i press cancel on confirmation , it still delete my data, any suggestions ?
thanks 🙂
pe2s
Your java-script code is looking correct. I don’t confirm but if you add this script on form
onsubmitevent then please check you have addreturn before function or not in form tag.If you can add your form code then it will be better to understand problem.
thanks