conformation alert using javascript

Sometimes it is useful to display a confirmation message before processing any action. Some application often asks for confirmation before doing something irreversible, like deleting content. 
the user to conform once again the deleting process. Here the user can change his mind and can cancel the operation or conform his action by clicking the submit button.

function confirmDelete(item){
 var strMsg = "Are you sure you want to delete this "+item+" ? ";
 var intAgree = confirm(strMsg);
 if (intAgree)
  return true ;
 else
  return false ;
}


No comments: