表单是这样的:
<form name="form2" method="post" action=""> 
<input type="button" name="Submit2" value="修改"onClick="form[this].action='edit.asp';form[this].submit();"> 
<input type="button" name="Submit3" value="修改"onClick="form[this].action='delete.asp';form[this].submit();"> 
</form>
js是这样的:
<script language="JavaScript" type="text/JavaScript">
  function delete_y(e)
   {
   if(event.srcElement.outerText == "删除")
   event.returnValue=confirm("确定删除?");
  }
  document.onclick=delete_y;
   </script> 
</head>
这个js写的不知道是否正确,忘大家指点.
现在的问题是如何在表单里调用这个js,忘高手指点,附上代码最佳

解决方案 »

  1.   

    <form   name= "form2 "   method= "post "   action= " ">   
    <input   type= "button "   name= "Submit2 "   value= "修改 "onClick= "delete_y();form[this].action= 'edit.asp ';form[this].submit(); ">   
    <input   type= "button "   name= "Submit3 "   value= "修改 "onClick= "delete_y();form[this].action= 'delete.asp ';form[this].submit(); ">   
    </form> 
    js是这样的: 
    <script   language= "JavaScript "   type= "text/JavaScript "> 
      function   delete_y(e) 
         { 
         if(event.srcElement.outerText   ==   "删除 ") 
         event.returnValue=confirm( "确定删除? "); 
      } 
      document.onclick=delete_y; 
         </script>   
    </head>