JQuery 从成功函数提交表单

发布于 2024-09-27 03:15:38 字数 853 浏览 2 评论 0原文

使用 uploadprogress 插件在文件上传期间显示进度栏,并尝试从成功功能提交表单。但这不起作用。这是 uploadprogress 的 url:

http://nixboxdesigns.com/demos/jquery-uploadprogress.php

jQuery('#review_form').uploadProgress({ 
  progressURL:'jquery-uploadprogress-demo-simple.php',
  displayFields : ['kb_uploaded','kb_average','est_sec'],
  start: function() { 
   jQuery('#upload-message').html('Uploading files now - please wait.'); 
   jQuery('input[type=submit]',this).val('Uploading... PLEASE WAIT');
  },
  success: function() { 

//$(this).unbind('submit').submit();                            
//$('#review_form').unbind('click');
//$('#review_form').unbind('submit');
// $('#review_form').submit();
// $('#review_form').trigger('submit');
jQuery(this).submit();
  }

Using the uploadprogress plugin to show the Progress Bar during file upload and try to submit the form from success function. But it doesn't work. Here is the url of the uploadprogress:

http://nixboxdesigns.com/demos/jquery-uploadprogress.php

jQuery('#review_form').uploadProgress({ 
  progressURL:'jquery-uploadprogress-demo-simple.php',
  displayFields : ['kb_uploaded','kb_average','est_sec'],
  start: function() { 
   jQuery('#upload-message').html('Uploading files now - please wait.'); 
   jQuery('input[type=submit]',this).val('Uploading... PLEASE WAIT');
  },
  success: function() { 

//$(this).unbind('submit').submit();                            
//$('#review_form').unbind('click');
//$('#review_form').unbind('submit');
// $('#review_form').submit();
// $('#review_form').trigger('submit');
jQuery(this).submit();
  }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梨涡 2024-10-04 03:15:38

为什么不使用jQuery(this).submit()

Why not jQuery(this).submit()?

暖风昔人 2024-10-04 03:15:38

从您的代码中我看到您正在尝试提交另一个表单 - review_form
不熟悉这个插件,但查看了他的示例,这应该可以工作:
$('#review_form').submit();

验证 review_form 是一个有效的表单(有一个操作)且 id="review_form"

from your code i see you are trying to submit another form - review_form
Not familiar with this plugin, but looked at his examples and this should work:
$('#review_form').submit();

verify that review_form is a valid form (has an action) with id="review_form"

故事还在继续 2024-10-04 03:15:38

进度条的工作与我的预期有所不同。包将表单提交到“form”操作属性中指定的位置。那里可以使用“文件”和其他表单元素。

我已经更改了代码以在那里进行实际工作并从调用页面重定向页面。因此,不需要我再次提交表格的问题。检查一个完整的示例:

http://www.ultramegatech.com/blog/2010/10/create-an-upload-progress-bar-with-php-and-jquery/

感谢所有帮助我的成员解决问题。尤其是“Avi Pinto”,提醒我做出回应的必要性。

The Progress Bar working is something different of what I expected. The package submitted the form to the location specified in the "form" action attribute. The "file" and other form elements are available there.

I have changed my code to do the actual working there and redirect the page from the calling page. Thus my question to submit the form again is not needed. check one complete example about this:

http://www.ultramegatech.com/blog/2010/10/create-an-upload-progress-bar-with-php-and-jquery/

Thank you for all members who helped me to resolve the issue. And especially "Avi Pinto" for reminding about the necessity of my responses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文