明月松間照 清泉石上流


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

          疑問:Struts 中JS的使用

          Posted on 2007-01-07 16:57 兵臨城下 閱讀(1128) 評論(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 我不是一個人在戰斗
          應該是緩存中的問題吧。。
          主站蜘蛛池模板: 荆州市| 新野县| 巴林左旗| 镇坪县| 巴里| 北安市| 昌黎县| 东辽县| 英德市| 东乌| 历史| 临西县| 固安县| 怀仁县| 肇东市| 太谷县| 司法| 萨嘎县| 诏安县| 桓台县| 涞源县| 合作市| 靖西县| 溧水县| 隆子县| 瑞昌市| 保亭| 临澧县| 西吉县| 赣州市| 九龙坡区| 五莲县| 喀什市| 西乌珠穆沁旗| 全南县| 普定县| 新营市| 大港区| 铁力市| 赣榆县| 河曲县|