提交按钮的type改成button<input type=button onclick='this.form.submit()'/>

解决方案 »

  1.   

    masse(当午) 
     
     
       提交按钮的type改成button<input type=button onclick='this.form.submit()'/>
      
     *********************************************************我现在是要提交成功后按钮变灰啊?如果我只是在<html:form中追加属性onsubmit="return validateUserForm(this);" 则表单提交验证是正确的.
      

  2.   

    得吃午饭了,发贴不是时候?upupup ,救救菜鸟``
      

  3.   

    <html>
    <body>
    <script type='text/javascript'>
    function valid()
    {
    return document.myform.a.value=="1";
    }
    function dosubmit(elem)
    {
     if(valid())
     {
         document.myform.submit();
         elem.disabled = true;
     }
    }
    </script>
    <form name=myform action=t.html target="hidfm">
    <input type=text name=a value="1"/>
    </form>
    <br/>
    <input type=button name=submit1 value='submit1' onclick='dosubmit(this)'/>
      <br/>
    <iframe name=hidfm src="" ></iframe>
    </body>
    </html>
      

  4.   

       非常感谢masse(当午).
    可能是我没说清楚,   我现在是想截获由validator在页面生成的 validateYouform(form)函数;  
       <html>
    <body>
    <script type='text/javascript'>
    function valid()
    {
    return document.myform.a.value=="1";
    }
    function dosubmit(elem)
    {
     if(valid())
     {
         document.myform.submit();
         elem.disabled = true;
     }
    }
    </script>
    *************************************************************                       <form name=myform action=t.html target="hidfm" 
         客户端验证由此调用    -----------> onsubmit="return validatemyform(this)">  
    我就是想在他return为True时,使按钮变灰.

    *****************************************************************
                   <input type=text name=a value="1"/>
    </form>
    <br/>
    <input type=button name=submit1 value='submit1' onclick='dosubmit(this)'/>
      <br/>
    <iframe name=hidfm src="" ></iframe>
    </body>
    </html>