I have this simple javascript function:
function updateDeleteUser(action, userid) {
frm = document.getElementById("frmsearch");
frm.frmUserId.value = userid;
switch (action) {
case 0:
frm.action = "UpdateUser.jsp";
break;
case 1:
confirm("Delete account?");
if (confirm != false){
frm.action = "DeleteUser.jsp";
}
}
frm.submit();
}
Even if I click on 'NO' the function runs anyway and user gets deleted. What did I do wrong?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire