[問題] 關於按鈕送出表單

看板Web_Design作者 (....)時間15年前 (2010/08/09 16:14), 編輯推噓0(004)
留言4則, 3人參與, 最新討論串1/1
我做了一個動態按鈕 想利用他來送出表單 我想問一下這樣寫為什麼不行?? 麻煩大家糾正一下我錯誤的地方謝謝 --------------------------------- 這是javascript的部分 <script type="text/javascript"> $(document).ready(function(){ $(".button").hover(function(){ $(".button img") //按鈕動的方式 .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200) .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100) .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100); }); }); 這是表單的部分 <form id="form1" name="form1" method="post" action=""> <a class="button" href="#" onClick="form1.submit()"> <img src="button.png" alt="" />送出表單</a> </form> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.87.50

08/09 20:11, , 1F
.submit() 要吃 input type="subimt"
08/09 20:11, 1F

08/09 22:10, , 2F
那請問有什麼submit的方式是吃這個的嗎?
08/09 22:10, 2F
※ 編輯: gais 來自: 140.115.87.50 (08/09 22:35)

08/10 15:38, , 3F
onclick="document.form1.submit();" 這樣才對吧...
08/10 15:38, 3F

08/10 15:38, , 4F
但寫這樣~會少一個~ onsubmit的動作~~
08/10 15:38, 4F
文章代碼(AID): #1CNxZqYq (Web_Design)