<img src="submit.gif" border="0" onClick="document.form1.submit()" >这种的话要这样写:<img src="submit.gif" border="0" onClick="checkapply()" > function checkapply(){
这里是表单检证if(表单检证 ==true ){
   document.form1.submit()
}
}

解决方案 »

  1.   

    哪里出错了.
    ----
    是你理解错了。
    formObj.submit()里不会再执行onsubmit
      

  2.   

    是不是<form name="form1" method="post" action="add_apply.php" onSubmit="return checkapply()" > 
    onSubmit="return checkapply()" 可以不要了其实就是点击图片之后调用javascript验证函数,如果不通过则弹出消息框,通过则调用document.form1.submit(),所以onSubmit="return checkapply()" 可以不要了.但为什么这种写法要改这么多?
      

  3.   

    <img src="submit.gif" border="0" onClick="document.form1.submit()"  >用这个onSubmit="return checkapply()"可以不要了onSubmit 是和 <input type="submit" name="" value="提交" >结合使用的,这是一种规则
      

  4.   

    document.form1.submit()不会再执行form的onsubmit?那么<input type="submit"...>则会执行form的onsubmit,这个怎么理解? 
      

  5.   

    基本问题请看参考书或问身边的同事:
    重点理解红色的两句:
    -----onsubmit Event  Internet Development Index --------------------------------------------------------------------------------Fires when a FORM is about to be submitted. SyntaxInline HTML <FORM onsubmit = "handler" ... >  All platforms 
    Event property FORM.onsubmit = handler JScript only 
    FORM.onsubmit = GetRef("handler") Visual Basic Scripting Edition (VBScript) 5.0 or later only 
    Named script <SCRIPT FOR = FORM EVENT = onsubmit>  Internet Explorer only Event InformationBubbles No 
    Cancels Yes 
    To invoke Submit a form using the INPUT TYPE=submit, INPUT TYPE=image, or BUTTON TYPE=submit object. 
    Default action Causes a form to be sent to whatever location is stipulated in the ACTION attribute of the form object.  
    ResYou can override this event by returning false in the event handler. Use this capability to validate data on the client side to prevent invalid data from being submitted to the server. If the event handler is called by the onsubmit attribute of the form object, the code must explicitly request the return value using the return function, and the event handler must provide an explicit return value for each possible code path in the event handler function.The submit method does not invoke the onsubmit event handler.