<form onsubmit="return confirm('Are you sure you want to rollback deletion of candidate table?')"> <input type='submit' name='delete' value='Undo' /> <input type='submit' name='no' value='No' />
解决方法
<form method='post'> <input type='submit' name='undo' value='Undo' onclick="return confirm('Are you sure you want to rollback deletion of candidate table?')"/> <input type='submit' name='no' value='No' onclick="return confirm('Are you sure you want to commit delete and go back?')"/> </form>
工作得很好.刚刚将onsubmit()更改为onclick().因为在这种情况下两者的功能是相同的.