onclick表单提交,打开jQuery加载图像,直到表单提交完成

问题描述:

您能提供一些建议吗?

我正在使用一个托管的SAAS CMS解决方案,该解决方案使您能够使用Web应用程序系统创建基础应用程序.我创建了一个表单,供成员向自己的区域提交一堆图像和内容.一切工作都很好,除非通过表单提交的图像很大,表单提交并进入感谢页面"需要花费一些时间.我已经在使用jQuery UI将表单分为5个步骤,并使用jQuery facebox插件进行说明性弹出窗口.

I am using a hosted SAAS CMS solution that enables you to create basing apps with a web apps system. I have created a form for members to submit a bunch of images and content to their own area. Everything is working great except if the images being submitted via the form are large, it takes ages for the form to submit and go to the thank you page. I am already using jQuery UI to split the form in to 5 steps and using the jQuery facebox plugin for instructional popups.

我的问题是,提交表单时,显示加载的gif(在面板或其他建议的覆盖图中)的最佳方法是什么?

My question is, what would be the best way to display a loading gif (in facebox or in another suggested overlay) while the form is being submitted?

感谢您的帮助! 杰克

$('#myForm').bind('submit', function() {
  $('#ajax-loading').show()
});

将加载图片放入ID为"ajax-loading"且css为"display:none;"的div中

Put your loading image inside a div with id "ajax-loading" with css "display: none;"