autosubmit form

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

// upload complete event 
Drupal.behaviors.fileUpload = {  
  attach: function(context, settings) {
    jQuery("body").ajaxComplete(function(event,request, settings){
      if (form_build_id = settings.url.match(/file\/ajax\/uploadcoupon\d*\/(.*)$/)) {
        if(jQuery('[value="'+form_build_id[1]+'"]').closest('form').find('[id$=remove-button]').length) {
          jQuery('[value="'+form_build_id[1]+'"]').closest('form').find('[id^=edit-submit]').click();  //trigger form submit
        }
      }
    })
  }
}
Help Share this Article