明月松間照 清泉石上流


                                                  ——— 兵臨城下   貓科動物
          posts - 70, comments - 137, trackbacks - 0, articles - 23
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          疑問:Struts 中JS的使用

          Posted on 2007-01-07 16:57 兵臨城下 閱讀(1121) 評論(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 我不是一個人在戰斗
          應該是緩存中的問題吧。。
          主站蜘蛛池模板: 科技| 阿城市| 甘孜县| 闽侯县| 扎鲁特旗| 泉州市| 恩平市| 合川市| 崇仁县| 乌海市| 广宗县| 巴青县| 昆山市| 乌苏市| 宁南县| 朝阳市| 盖州市| 习水县| 景德镇市| 南平市| 喀喇| 新泰市| 宾川县| 铁力市| 江津市| 玛多县| 大田县| 禹州市| 水富县| 石柱| 平泉县| 凤城市| 维西| 英吉沙县| 科技| 什邡市| 韶关市| 丹阳市| 湘西| 巴东县| 满城县|