I have a simple form with remote=true.
(我有一个带有remote = true的简单表单。)
This form is actually on an HTML Dialog, which gets closed as soon as the Submit button is clicked.
(此表单实际上位于HTML对话框上,一旦单击“提交”按钮,该对话框就会关闭。)
Now I need to make some changes on the main HTML page after the form gets submitted successfully.
(现在,我需要在表单成功提交后对主HTML页面进行一些更改。)
I tried this using jQuery.
(我尝试使用jQuery。)
But this doesn't ensure that the tasks get performed after some form of response of the form submission.(但这并不能确保在表单提交的某种形式的响应之后执行任务。)
$("#myform").submit(function(event) {
// do the task here ..
});
How do I attach a callback, so that my code gets executed only after the form is successfully submitted?
(如何附加回调,以便我的代码只有在成功提交表单后才能执行?)
Is there any way to add some .success or .complete callback to the form?(有没有办法在表单中添加一些.success或.complete回调?)
ask by geeky_monster translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…