Three ways to use javascript validation boxes

  • 2020-03-30 00:54:01
  • OfStack

The first method: very good, after confirmation can open the download address page. The principle is also clearer. Mainly used to delete a single message confirmation.

<SCRIPT LANGUAGE=javascript> 
function del() { 
  var msg = " Are you sure you want to delete it? nn Please confirm! "; 
  if (confirm(msg)==true){ 
    return true; 
    return false; 

Call method:

 <a href="del.php?id=123" onclick="javascript:return del()"> delete   In addition to </a> 

Second method: the principle is the same as above. JavaScript removes the confirmation box

<a href="javascript:if(confirm(' Are you sure you want to delete it ?'))location='jb51.php?id='"> delete </a>

Third: mainly used for batch deletion of the confirmation prompt

<input name="Submit" type="submit" class="inputedit" value=" delete " 
  onclick="{if(confirm(' Is there a record? ?')){
    return true;}return false;
<input name=" button " type="button" ID="ok" onclick="{if(confirm(' Are you sure to delete it? ?')){
  return true;
}return false;}" value=" Delete columns " />

Related articles: