1. 程式人生 > >js彈出可以選擇是否的對話方塊

js彈出可以選擇是否的對話方塊

<form name="form1" action="alert.htm">

<input type="button" name="button1" class="txt_2" value="刪除" onClick="javascript:check_really_submit()">
         
</form>

<script>
 function back_dsj_cx(){
   document.form2.submit();
 }
 
 function check_really_submit(){
  if(document.form1.button1.value=="刪除"){
   if(window.confirm("確實要刪除嗎?"))
   {
    document.form1.action="../memorabiliaServlet";
    document.form1.submit();
   }
  }
 }
 
</script>