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:
- // give pre-submit callback an opportunity to abort the submit
- if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
- log('ajaxSubmit: submit aborted via beforeSubmit callback');
- return this;
- }
Here is my HTML form:
- <div id="upload_dialog" style="display:none;" title="Upload File" >
- <div>
- <form id="upload_form" method='post' enctype='multipart/form-data' >
-
- Title:<br><input type="text" id='file_name' name='file_name' /><br />
- <label for="filedata">File:</label><span id="filename"></span><br /><input type="file" name="filedata" id="file_data" onchange="updatefilename();"/><br />
- Description:<br/><textarea rows="4" cols="30" name="file_desc" id="file_desc"></textarea><br />
- <input type="submit" name="submit" onclick="uploadFile();return false;" value="Submit"/>
- </form>
- </div>
- <div id="uploading">loading please wait<div id="uploadProgress"></div></div>
- <div id="uploadoutput" ></div>
- </div>
The form is in a JqueryUI.dialog()
Here is the code I'm using to submit the file and field values:
- function uploadFile(){
- var org = jQuery('#org').attr('value');
- jQuery('#upload_form').ajaxSubmit({
- type:'POST',
- target:'#uploadoutput',
- url: 'index.php?option=com_collector&task=newFile&tmpl=component&org=' + org,
- beforeSubmit: beforeupload(),
- uploadProgress: function(event, position, total, percentComplete) {
-
- jQuery( "#uploadProgress" ).progressbar({
- value: percentComplete
- });
- },
- success: onsuccess()
- });
-
-
- return false;
- }
-
- function beforeupload() {
- jQuery('#upload_form').hide();
- jQuery('#uploading').show();
- jQuery( "#uploadProgress" ).progressbar({
- value: 0
- });
- // here we could return false to prevent the form from being submitted;
- // returning anything other than false will allow the form submit to continue
- return true;
- }
-
- function onsuccess() {
- jQuery('#uploading').hide();
- jQuery('#uploadoutput').show();
-
- }
can screen shot if needed