jQuery malsup Form Plugin Ie 7 failing

jQuery malsup Form Plugin Ie 7 failing

Hi

I'm Using the plugin from http://malsup.com/jquery/form, which works fantastically in FF and Chrome but is throwing errors in IE 7 which is a pain as most of the users will be using I.E.

I am using
* jQuery Form Plugin
* version: 3.09 (16-APR-2012)
I have tried both jQuery 1.4.2.min.js ans 1.7.2.min.js libraries

I have switched on IE debugging and it is reporting:
Runtime error Line: 121 function expected

this is the line the debugger is highlighting:
  1.     // give pre-submit callback an opportunity to abort the submit
  2.     if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
  3.         log('ajaxSubmit: submit aborted via beforeSubmit callback');
  4.         return this;
  5.     }

Here is my HTML form:

  1. <div id="upload_dialog" style="display:none;" title="Upload File" >
  2.                 <div>
  3.                 <form id="upload_form" method='post' enctype='multipart/form-data' >
  4.                     
  5.                     Title:<br><input type="text" id='file_name' name='file_name' /><br />
  6.                     <label for="filedata">File:</label><span id="filename"></span><br /><input type="file" name="filedata" id="file_data" onchange="updatefilename();"/><br />
  7.                     Description:<br/><textarea rows="4" cols="30" name="file_desc" id="file_desc"></textarea><br />
  8.                     <input type="submit" name="submit" onclick="uploadFile();return false;" value="Submit"/>
  9.                 </form>
  10.                 </div>
  11.                 <div id="uploading">loading please wait<div id="uploadProgress"></div></div>
  12.                 <div id="uploadoutput" ></div>
  13.             </div>

The form is in a JqueryUI.dialog()
Here is the code I'm using to submit the file and field values:

  1.     function uploadFile(){
  2.     var org = jQuery('#org').attr('value');   
  3.     jQuery('#upload_form').ajaxSubmit({
  4.             type:'POST',
  5.             target:'#uploadoutput',
  6.             url: 'index.php?option=com_collector&task=newFile&tmpl=component&org=' + org,
  7.             beforeSubmit:  beforeupload(),
  8.             uploadProgress: function(event, position, total, percentComplete) {
  9.                
  10.                 jQuery( "#uploadProgress" ).progressbar({
  11.                         value: percentComplete
  12.                     });       
  13.             },
  14.             success: onsuccess()
  15.             });
  16.    
  17.    
  18.     return false;
  19.     }
  20.    
  21.     function beforeupload() {
  22.     jQuery('#upload_form').hide();
  23.     jQuery('#uploading').show();
  24.     jQuery( "#uploadProgress" ).progressbar({
  25.                         value: 0
  26.                     });       
  27.     // here we could return false to prevent the form from being submitted;
  28.     // returning anything other than false will allow the form submit to continue
  29.     return true;
  30. }
  31.    
  32.     function onsuccess()  {
  33.     jQuery('#uploading').hide();
  34.     jQuery('#uploadoutput').show();
  35.  
  36. }
can screen shot if needed






















    • Topic Participants

    • info