也許這是重複的問題,但我還沒有得到任何答案,但我提交了一個帶有兩個不同操作URL的表單。 首次表單提交但二次表單不提交,僅在Chrome瀏覽器中發生。
表單標籤:
<form class="form-vertical" id="renters-form" action="/renters/media" method="post">
我有兩個按鈕。
<input type="button" class="btn button-next" id="next" name="next" value="Continue" />
<input type="button" class="btn button-next" id="previewprofile" value="Preview Profile" style="display:nonoe;" />
該代碼首次運行,表單將被提交。
$("#next").on('click', function(){
$("form").submit();
});
但第二次
$("#previewprofile").click(function(){
alert('test');
$("#renters-form").submit();
});
沒有工作,形式id爲renters-form
形式爲什麼沒有在Chrome瀏覽器提交?
表單名稱是租房形式或表單id是租房形式)? – skrilled
它提醒你嗎? – Fallenreaper
顯示'租房形式'的html。 – Jasen