开发者

JQuery Submit form from success function

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开发者_如何学JAVA_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();
  }


Why not jQuery(this).submit()?


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"


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜