我有一個表單有兩個提交按鈕,一個叫'display',另一個叫'disenrol'。顯示提交不需要確認,而其他提交。本來我打算使用Javascript onsmit with form with multiple submits buttons
onsubmit="return confirm('Are you sure you want to remove the modules?');"
但當然,這將無法正常工作,因爲它對兩個提交作出反應。有沒有一種方法可以指定哪些提交應該值得? (我很新的JavaScript所以請溫柔的我)
感謝
的可能的複製[如何使用的onsubmit()顯示有多個確認提交按鈕?](http://stackoverflow.com/questions/18038085/how-to-use-onsubmit-show-a-confirmation-with-multiple-submit-buttons) –