明月松间照 清泉石上流


                                        ——— 兵临城下   猫科动物
posts - 70, comments - 137, trackbacks - 0, articles - 23
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

疑问:Struts 中JS的使用

Posted on 2007-01-07 16:57 兵临城下 阅读(1102) 评论(5)  编辑  收藏 所属分类: JavaScript
有这样一段Html:
    <html:form action="/Logon.do" method="POST">
      <table border="0">
        <tr>
          <td>UserName:</td>
          <td><html:text property="userName" /></td>
        </tr>
        <tr>
          <td>Password:</td>
          <td><html:password property="userPws" /></td>
        </tr>
        <tr>
          <td><html:button property="submit" value="submit" onclick="test()" /></td>
          <td><html:cancel /></td>
        </tr>
      </table>
    </html:form>

submit的js方法如下:
 <script language = "javascript">
  function test() {
    document.forms[0].submit();
  }
 </script>
为什么总是提交不了呢?提示对象不支持此属性和方法。

评论

# re: 疑问:Struts 中JS的使用  回复  更多评论   

2007-01-12 16:06 by samfree[匿名]
你没有在js里写submit()方法吧

# re: 疑问:Struts 中JS的使用  回复  更多评论   

2007-01-17 15:06 by 小雪飞刀
用<html:submit>而不是<html:button>

# re: 疑问:Struts 中JS的使用  回复  更多评论   

2007-01-17 19:58 by 兵临城下
什么啊,没看到我调用js方法了吗?看清楚

# re: 疑问:Struts 中JS的使用  回复  更多评论   

2007-01-21 15:28 by 兵临城下
突然又好了,搞不清楚!

# re: 疑问:Struts 中JS的使用  回复  更多评论   

2008-04-28 11:39 by 我不是一个人在战斗
应该是缓存中的问题吧。。

只有注册用户登录后才能发表评论。


网站导航: