Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:44:56+00:00 2026-05-23T16:44:56+00:00

I am using this version of jQuery form plugin https://raw.github.com/malsup/form/master/jquery.form.js getting an error on

  • 0

I am using this version of jQuery form plugin https://raw.github.com/malsup/form/master/jquery.form.js
getting an error on submit:

error on line form.submit();

SCRIPT87: Invalid argument. jquery.form.js, line 347 character 5

My code:

<form id="ajaxUploadForm" action="@Url.Action("Upload", "Home")%>" method="post" enctype="multipart/form-data" >
    <fieldset>
        <legend>Upload a file</legend>
        <label>File to Upload: <input type="file" name="file" /></label>
        <input id="ajaxUploadButton" type="submit" value="Upload" />
    </fieldset>
</form> 

$(function () {
        $("#ajaxUploadForm").ajaxForm({
            iframe: true,
            dataType: "json",
            beforeSubmit: function () {
               // $("#ajaxUploadForm").block({ message: '<img src="/Content/themes/start/images/progress.gif" />' });
            },
            success: function (result) {
               // $("#ajaxUploadForm").unblock();
                //$("#ajaxUploadForm").resetForm();
                $.growlUI(null, result.message);
            },
            error: function (xhr, textStatus, errorThrown) {
                //$("#ajaxUploadForm").unblock();
                //$("#ajaxUploadForm").resetForm();
                $.growlUI(null, 'Error uploading file');
            }
        });
    });

I am doing this upload in side simple model dialog.

May be some one may have any ideas how ti fix that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:44:57+00:00Added an answer on May 23, 2026 at 4:44 pm

    If the controller action that you are POSTing to is returning JSON you might need to wrap it in a <textarea> tags as explained in the documentation:

    Since it is not possible to upload
    files using the browser’s
    XMLHttpRequest object, the Form Plugin
    uses a hidden iframe element to help
    with the task. This is a common
    technique, but it has inherent
    limitations. The iframe element is
    used as the target of the form’s
    submit operation which means that the
    server response is written to the
    iframe. This is fine if the response
    type is HTML or XML, but doesn’t work
    as well if the response type is script
    or JSON, both of which often contain
    characters that need to be repesented
    using entity references when found in
    HTML markup.

    To account for the challenges of
    script and JSON responses, the Form
    Plugin allows these responses to be
    embedded in a textarea element and it
    is recommended that you do so for
    these response types when used in
    conjuction with file uploads. Please
    note, however, that if there is no
    file input in the form then the
    request uses normal XHR to submit the
    form (not an iframe). This puts the
    burden on your server code to know
    when to use a textarea and when not
    to. If you like, you can use the
    iframe option of the plugin to force
    it to always use an iframe mode and
    then your server can always embed the
    response in a textarea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this jQuery validation plugin and getting the famous: $(#Form).validate is not a
I am using the multi-upload plugin found at: http://www.fyneworks.com/jquery/multiple-file-upload/ This is what I am
I have got this error when using Enterprise Library 3.1 May 2007 version. We
I'm using intelliJ IDEA version 9.0.1 build #IU 93.94 with JDK 1.6.0_17. This error
I've been using the JQuery Autocomplete plugin with JQuery version 1.3.2, and it has
I am using the jquery form validation plugin to validate a long form. If
I am using Jquery valdiation plugin for validating the form at client side. I
I'm using the latest version of the jQuery Validator plugin along with jQuery (1.6.2).
I'm using the latest version of the jQuery Validator plugin along with jQuery (1.6.2).
This is in JQuery, using the JQuery-UI version of autocomplete I'm in a bit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.