明月松間照 清泉石上流


                                                  ——— 兵臨城下   貓科動物
          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 我不是一個人在戰斗
          應該是緩存中的問題吧。。
          主站蜘蛛池模板: 信宜市| 朝阳市| 昌乐县| 岳阳市| 万源市| 丰镇市| 红安县| 潞西市| 阜阳市| 开江县| 西昌市| 栾城县| 长治县| 临西县| 潜山县| 衡南县| 太湖县| 阿坝| 通州区| 通道| 延津县| 黑山县| 湟源县| 平乐县| 突泉县| 乃东县| 淮北市| 镇原县| 吉安市| 镇巴县| 太和县| 英超| 于都县| 金秀| 浙江省| 上饶县| 揭阳市| 潮安县| 封开县| 广州市| 安乡县|