通过Ajax加载以下内容时,它不起作用:
<form action="...." onsubmit="return confirm('Do you really want to cancel this plan?');">
不出现确认对话框。具有相同动作的多种形式。使用Jquery的绑定将无效,因为没有单个ID。我应该在使用类名的事件上使用jquery进行绑定吗?
答案 0 :(得分:-1)
最好使用提交按钮的onclick
事件。
例如:
<form method='post'>
<input type='submit' name='undo' value='Undo' onclick="return confirm('Do you really want to cancel this plan?');"/>
</form>