在提交之前不写Action,也就是不写着一句document.forms[0].action="<%=request.getContextPath()%>/KjnWorkSrch.do"

解决方案 »

  1.   

    楼上的什么意思,不写提交action的话,我要到什么时候提交action呢,假如我的语句是这样的
    <html:link href="javascript:form.submit();" onclick="valid();">提交</html:link>
    form是<html:form action="addAction.do"/>,那我要怎么做,才能只弹出消息框不提交action 执行?
      

  2.   

    感觉说的应该是js验证function formCheck(){   
      if  (trim(document.all("name").value)=="")
      {   alert("请输入name");
      document.all("name").focus();
              return false;
      }
      if  (trim(document.all("newsContent.ordernum").value)=="")
      {   alert("请设定显示序号");
      document.all("newsContent.ordernum").focus();
      return false;
      }
         return true;
    }
      

  3.   

    不要用<html:link>标签
    使用<a href="javascript:f()">..</a>
    在Js中,如果检验成功,则form.submit(); 否则return;
      

  4.   

    <form onsubmit="return confirm('真的提交么?')">
      

  5.   

    用 span 或者是 button    你不用 link  行不行呀!  link 当然会触发
      

  6.   

    onclick="return valid();"然后在你的javascript的valid函数中,如果此链接点击失效则return false如果你在javascript中都是提交form了,一直都不需要此链接生效(意思是页面跳转到此链接指定的地方),你可以"valid();return false"
      

  7.   

    return false没用.
    关键是
    focus()
    让焦点回到本页,它就不提交了.