jQuery Form Plugin

Overview

jQuery Form Build Status

Overview

The jQuery Form Plugin allows you to easily and unobtrusively upgrade HTML forms to use AJAX. The main methods, ajaxForm and ajaxSubmit, gather information from the form element to determine how to manage the submit process. Both of these methods support numerous options which allow you to have full control over how the data is submitted.

No special markup is needed, just a normal form. Submitting a form with AJAX doesn't get any easier than this!

Community

Want to contribute to jQuery Form? Awesome! See CONTRIBUTING for more information.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct to ensure that this project is a welcoming place for everyone to contribute to. By participating in this project you agree to abide by its terms.

Pull Requests Needed

Enhancements needed to to be fully compatible with jQuery 3

jQuery 3 is removing a lot of features that have been deprecated for a long time. Some of these are still in use by jQuery Form.
Pull requests and assistance in updating jQuery Form to be compatible with jQuery 3 are greatly appreciated.
See issue #544 for more information.

Compatibility

  • Requires jQuery 1.7.2 or later.
  • Compatible with jQuery 2.
  • Partially compatible with jQuery 3.
  • Not compatible with jQuery 3 Slim. (issue #544)

Download

CDN

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.3.0/jquery.form.min.js" integrity="sha384-qlmct0AOBiA2VPZkMY3+2WqkHtIQ9lSdAsAn5RUJD/3vA5MKDgSGcdmIv4ycVxyn" crossorigin="anonymous"></script>

or

<script src="https://cdn.jsdelivr.net/gh/jquery-form/[email protected]/dist/jquery.form.min.js" integrity="sha384-qlmct0AOBiA2VPZkMY3+2WqkHtIQ9lSdAsAn5RUJD/3vA5MKDgSGcdmIv4ycVxyn" crossorigin="anonymous"></script>

API

jqXHR

The jqXHR object is stored in element data-cache with the jqxhr key after each ajaxSubmit call. It can be accessed like this:

var form = $('#myForm').ajaxSubmit({ /* options */ });
var xhr = form.data('jqxhr');

xhr.done(function() {
...
});

ajaxForm( options )

Prepares a form to be submitted via AJAX by adding all of the necessary event listeners. It does not submit the form. Use ajaxForm in your document's ready function to prepare existing forms for AJAX submission, or with the delegation option to handle forms not yet added to the DOM.
Use ajaxForm when you want the plugin to manage all the event binding for you.

// prepare all forms for ajax submission
$('form').ajaxForm({
    target: '#myResultsDiv'
});

ajaxSubmit( options )

Immediately submits the form via AJAX. In the most common use case this is invoked in response to the user clicking a submit button on the form. Use ajaxSubmit if you want to bind your own submit handler to the form.

// bind submit handler to form
$('form').on('submit', function(e) {
    e.preventDefault(); // prevent native submit
    $(this).ajaxSubmit({
        target: '#myResultsDiv'
    })
});

Options

Note: All standard $.ajax options can be used.

beforeSerialize

Callback function invoked before form serialization. Provides an opportunity to manipulate the form before its values are retrieved. Returning false from the callback will prevent the form from being submitted. The callback is invoked with two arguments: the jQuery wrapped form object and the options object.

beforeSerialize: function($form, options) {
    // return false to cancel submit
}

beforeSubmit

Callback function invoked before form submission. Returning false from the callback will prevent the form from being submitted. The callback is invoked with three arguments: the form data in array format, the jQuery wrapped form object, and the options object.

beforeSubmit: function(arr, $form, options) {
    // form data array is an array of objects with name and value properties
    // [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
    // return false to cancel submit
}

beforeFormUnbind

Callback function invoked before form events unbind and bind again. Provides an opportunity to manipulate the form before events will be remounted. The callback is invoked with two arguments: the jQuery wrapped form object and the options object.

beforeFormUnbind: function($form, options) {
    // your callback code
}

filtering

Callback function invoked before processing fields. This provides a way to filter elements.

filtering: function(el, index) {
    if ( !$(el).hasClass('ignore') ) {
        return el;
    }
}

clearForm

Boolean flag indicating whether the form should be cleared if the submit is successful

data

An object containing extra data that should be submitted along with the form.

data: { key1: 'value1', key2: 'value2' }

dataType

Expected data type of the response. One of: null, 'xml', 'script', or 'json'. The dataType option provides a means for specifying how the server response should be handled. This maps directly to jQuery's dataType method. The following values are supported:

  • 'xml': server response is treated as XML and the 'success' callback method, if specified, will be passed the responseXML value
  • 'json': server response will be evaluated and passed to the 'success' callback, if specified
  • 'script': server response is evaluated in the global context

delegation

true to enable support for event delegation requires jQuery v1.7+

// prepare all existing and future forms for ajax submission
$('form').ajaxForm({
    delegation: true
});

error

Deprecated
Callback function to be invoked upon error.

forceSync

Only applicable when explicity using the iframe option or when uploading files on browsers that don't support XHR2. Set to true to remove the short delay before posting form when uploading files. The delay is used to allow the browser to render DOM updates before performing a native form submit. This improves usability when displaying notifications to the user, such as "Please Wait..."

iframe

Boolean flag indicating whether the form should always target the server response to an iframe instead of leveraging XHR when possible.

iframeSrc

String value that should be used for the iframe's src attribute when an iframe is used.

iframeTarget

Identifies the iframe element to be used as the response target for file uploads. By default, the plugin will create a temporary iframe element to capture the response when uploading files. This option allows you to use an existing iframe if you wish. When using this option the plugin will not attempt handling the response from the server.

method

The HTTP method to use for the request (e.g. 'POST', 'GET', 'PUT').

replaceTarget

Optionally used along with the target option. Set to true if the target should be replaced or false if only the target contents should be replaced.

resetForm

Boolean flag indicating whether the form should be reset if the submit is successful

semantic

Boolean flag indicating whether data must be submitted in strict semantic order (slower). Note that the normal form serialization is done in semantic order except for input elements of type="image". You should only set the semantic option to true if your server has strict semantic requirements and your form contains an input element of type="image".

success

Deprecated
Callback function to be invoked after the form has been submitted. If a 'success' callback function is provided it is invoked after the response has been returned from the server. It is passed the following standard jQuery arguments:

  1. data, formatted according to the dataType parameter or the dataFilter callback function, if specified
  2. textStatus, string
  3. jqXHR, object
  4. $form jQuery object containing form element

target

Identifies the element(s) in the page to be updated with the server response. This value may be specified as a jQuery selection string, a jQuery object, or a DOM element.

type

The HTTP method to use for the request (e.g. 'POST', 'GET', 'PUT').
An alias for method option. Overridden by the method value if both are present.

uploadProgress

Callback function to be invoked with upload progress information (if supported by the browser). The callback is passed the following arguments:

  1. event; the browser event
  2. position (integer)
  3. total (integer)
  4. percentComplete (integer)

url

URL to which the form data will be submitted.


Utility Methods

formSerialize

Serializes the form into a query string. This method will return a string in the format: name1=value1&name2=value2

var queryString = $('#myFormId').formSerialize();

fieldSerialize

Serializes field elements into a query string. This is handy when you need to serialize only part of a form. This method will return a string in the format: name1=value1&name2=value2

var queryString = $('#myFormId .specialFields').fieldSerialize();

fieldValue

Returns the value(s) of the element(s) in the matched set in an array. This method always returns an array. If no valid value can be determined the array will be empty, otherwise it will contain one or more values.

resetForm

Resets the form to its original state by invoking the form element's native DOM method.

clearForm

Clears the form elements. This method empties all of the text inputs, password inputs and textarea elements, clears the selection in any select elements, and unchecks all radio and checkbox inputs. It does not clear hidden field values.

clearFields

Clears selected field elements. This is handy when you need to clear only a part of the form.


File Uploads

The Form Plugin supports the use of XMLHttpRequest Level 2 and FormData objects on browsers that support these features. As of today (March 2012) that includes Chrome, Safari, and Firefox. On these browsers (and future Opera and IE10) files uploads will occur seamlessly through the XHR object and progress updates are available as the upload proceeds. For older browsers, a fallback technology is used which involves iframes. More Info


Contributors

This project has transferred from github.com/malsup/form, courtesy of Mike Alsup.
See CONTRIBUTORS for details.

License

This project is dual-licensed under the LGPLv2.1 (or later) or MIT licenses:


Additional documentation and examples for version 3.51- at: http://malsup.com/jquery/form/

Comments
  • jquery.form.js, Line 352 Character 5

    jquery.form.js, Line 352 Character 5

    I got this error:

    SCRIPT5: Access Denied. jquery.form.js, Line 352 Character 5

    :/, i searched so much on this issue and didnt find any solutions.

    $('#crop_form').bind('submit', function(e){ e.preventDefault(); // <-- important $(this).ajaxSubmit({ target: '#output', success: function() { hideLoading(); } }); });

    opened by Linkupdated 36
  • Compatibility with jQuery 1.8.0?

    Compatibility with jQuery 1.8.0?

    Hi,

    When I switch my site's jQuery from 1.7.2 to 1.8.0, upon doing an ajaxSubmit I get an "access is denied" error. Not sure if this is helpful, but this is the code block in jQuery that was highlighted for the exception.

    return c=c||e,c=(c[0]||c).ownerDocument||c[0]||c,typeof c.createDocumentFragment=="undefined"&&(c=e),a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}

    Switching back to jQuery 1.7.2, it works fine. (IE9.)

    Has anyone else see any issues using jQuery form with jQuery 1.8.0?

    -Ben

    opened by benrhere 26
  • Failed to submit form when no file selected

    Failed to submit form when no file selected

    Version 2.87 worked fine until upgraded to 3.02.

    Getting error "file exceeds the defined ini size" when submitting a form without file selected. If force to use iframe than everything works fine, but thats not a solution.

    I analyzed the all version until 3.02 and find out than changes in 2.90 made this error.

    just commented:

    //  causing errors
    //  var fileAPI = feature.fileapi && feature.formdata;
    var fileAPI = false;
    

    for temporary solution

    opened by alexius 21
  • Latest Chrome update breaks plugin response handling

    Latest Chrome update breaks plugin response handling

    Description:

    After the latest Chrome update (mine is 83.0.4103.61) the success callback is not called anymore if using iframe:true although the request gets to the server. Chrome dev tools shows request as cancelled. I managed to fix this by setting iframeSrc:'about:blank'. I cannot find a reason or implication of this change. But maybe iframeSrc default should be changed?

    Expected Behavior:

    Receive success callback with response from server.

    Actual behavior:

    Success callback is not called, request shows aborted in Chrome.

    Versions:

    LoadJSON:
    jQuery: 3.4 Browsers: Chrome 83.0.4103.61

    Demonstration

    Demo here

    Steps to reproduce:

    Use default setting of iframeSrc

    opened by webmasterlv 17
  • Different submit behavior when using uploadProgress

    Different submit behavior when using uploadProgress

    I use ajaxSubmit to submit a form to a third party url. I use the following code.

    $("#uploadToYoutubeForm").ajaxSubmit({
                                url: "http://www.example.com?nexturl=someurl",
                                type: 'post',
    
                               uploadProgress: function(event, position, total, percentComplete) {
    
                                },
    
                               complete: function(response){
                                            alert("complete");                      
                                }
                            });
    

    My problem is that there is a different behavior when I use uploadProgress. The server executes the nexturl only when I do not use uploadProgress. When I use uploadProgress the nexturl will not be called.

    What can I do?

    opened by confile 14
  • ajaxSubmit not compatible with jQuery>=1.12.1

    ajaxSubmit not compatible with jQuery>=1.12.1

    I don't know if this plugin is still supported (it seems it's not), but in case anyone is interested, there is a problem with this code in ajaxSubmit:

        if (!options.dataType && options.target) {
            var oldSuccess = options.success || function(){};
            callbacks.push(function(data) {
                var fn = options.replaceTarget ? 'replaceWith' : 'html';
                $(options.target)[fn](data).each(oldSuccess, arguments);
            });
        }
    

    because, in jQuery 1.12.1, they have changed the function each() from

        // Execute a callback for every element in the matched set.
        // (You can seed the arguments with an array of args, but this is
        // only used internally.)
        each: function( callback, args ) {
            return jQuery.each( this, callback, args );
        },
    

    to

        // Execute a callback for every element in the matched set.
        each: function( callback ) {
            return jQuery.each( this, callback );
        },
    

    That means that the success callback function is called without parameters.

    enhancement need more info 
    opened by senendds 12
  • Not getting correct response on client from .ajaxForm() success.

    Not getting correct response on client from .ajaxForm() success.

    I'm not 100% sure this is an issue with this plugin but In IE8 and 9 - I'm getting an incorrect response when I use .ajaxForm() to send a query, and then parse the response.

    Instead of getting the expected XML string in the jqXHR.responseText, I'm being passed the client side HTML of the page.

    I've posted this to stack overflow here: http://stackoverflow.com/questions/18733754/incorrect-jqxhr-response-for-jquery-forms-plugin-in-ie8-and-9

    And found another sample of the (same?) problem here: http://stackoverflow.com/questions/17473719/jquery-form-plugin-the-server-generates-correct-json-response-but-ie-receives

    opened by jameskirsop 12
  • Update default iframeSrc to be 'about:blank' for browsers other than IE

    Update default iframeSrc to be 'about:blank' for browsers other than IE

    Resolves #571

    As stated in #571 chrome is expecting "about:blank"

    yet we're passing javascript:false if the page is HTTPS.

    This was originally added with this default value in ce4324159ecd44cab4779bef6f6d484aef958c5c without any real explanation for why javascript:false was used.

    Given that "about:blank" is required in the spec and it fixes the current issue with Chrome, let's use it as the default even for HTTPS.

    Edit: javacript:false is required by IE browsers, this PR applies the javascript:false default only when the browser is detected to be IE.

    opened by KorvinSzanto 11
  • IE9 bad request body generation

    IE9 bad request body generation

    Description:

    Well, this is a very delicated issue, which I have no idea how to deal with.

    I have a form where I work with complex data object generation. Like the following:

    {
        "Id": 123564,
        "Nome": "Test, example name",
        "OtherFields": "Other fields values",
        "LaminaExposicaoComposicaoProdutos": [
            {
                "Id": 123456,
                "Nome": "Example name",
                "Codigo": "987456213"
            }, {
                "Id": 223456,
                "Nome": "Another Example name",
                "Codigo": "287456213"
            }
        ]
    }
    

    The object is that, but the request generated in IE9 differs a lot from IE10.

    image

    image

    IE9 vs. IE10 request body

    diff --git a/ie9/rq-body b/ie10/rq-body
    index 0ea0aa5..b73a090 100644
    --- a/ie9/rq-body
    +++ b/ie10/rq-body
    @@ -1,198 +1,253 @@
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Id"
    
     0
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdLaminaExposicao"
    
     2
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdUsuarioCadastro"
    
     0
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdUsuarioAlteracao"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="DataCadastro"
    
     01/01/0001 00:00:00
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="DataAlteracao"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Nome"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Situacao"
    
     Ativo
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="AnoSemanaEntregaInicial"
    
     2017
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="SemanaEntregaInicial"
    
     39
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="AnoSemanaEntregaFinal"
    
     2017
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="SemanaEntregaFinal"
    
     40
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Observacao"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Produto.Id"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Produto.Codigo"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Produto.Nome"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     29312
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     29313
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     29314
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144414
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144415
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144419
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144489
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144494
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     144496
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     344600
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     344602
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[][IdProduto]"
    
     344606
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="OrdemCompra.Id"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="OrdemCompra.Codigo"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="LaminaExposicaoComposicaoOrdemCompras[][IdOrdemCompra]"
    
     531706
    ------------------------------7e113736f068a
    -Content-Disposition: form-data; name="ImagemCapa"; filename=""
    -Content-Type: application/octet-stream
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="ImagemCapa"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Id"
    
     0
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdLaminaExposicao"
    
     2
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdUsuarioCadastro"
    
     0
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="IdUsuarioAlteracao"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="DataCadastro"
    
     01/01/0001 00:00:00
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="DataAlteracao"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Nome"
    
    
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Situacao"
    
     Ativo
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="AnoSemanaEntregaInicial"
    
     2017
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="SemanaEntregaInicial"
    
     39
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="AnoSemanaEntregaFinal"
    
     2017
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="SemanaEntregaFinal"
    
     40
    ------------------------------7e113736f068a
    +-----------------------------7e129812f068a
     Content-Disposition: form-data; name="Observacao"
    
    
    ------------------------------7e113736f068a
    -Content-Disposition: form-data; name="Produto"
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="Produto[Id]"
    
    -[object Object]
    ------------------------------7e113736f068a
    -Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos"
    
    -[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
    ------------------------------7e113736f068a
    -Content-Disposition: form-data; name="OrdemCompra"
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="Produto[Codigo]"
    
    -[object Object]
    ------------------------------7e113736f068a
    -Content-Disposition: form-data; name="LaminaExposicaoComposicaoOrdemCompras"
    
    -[object Object]
    ------------------------------7e113736f068a--
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="Produto[Nome]"
    +
    +
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[0][IdProduto]"
    +
    +29312
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[1][IdProduto]"
    +
    +29313
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[2][IdProduto]"
    +
    +29314
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[3][IdProduto]"
    +
    +144414
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[4][IdProduto]"
    +
    +144415
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[5][IdProduto]"
    +
    +144419
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[6][IdProduto]"
    +
    +144489
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[7][IdProduto]"
    +
    +144494
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[8][IdProduto]"
    +
    +144496
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[9][IdProduto]"
    +
    +344600
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[10][IdProduto]"
    +
    +344602
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoProdutos[11][IdProduto]"
    +
    +344606
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="OrdemCompra[Id]"
    +
    +
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="OrdemCompra[Codigo]"
    +
    +
    +-----------------------------7e129812f068a
    +Content-Disposition: form-data; name="LaminaExposicaoComposicaoOrdemCompras[0][IdOrdemCompra]"
    +
    +531706
    +-----------------------------7e129812f068a--
    (END)
    

    That's it!

    Expected Behavior: I want to receive a multilevel object in my action endpoint. That object is not being generated in JS code.

    Actual behavior: I'm receiving an single level object in my action endpoint. The multilevel object has only the first level well writed in the request body.

    Versions:

    LoadJSON: N/A jQuery: any Browsers: IE9

    Demonstration

    Can't reproduce in an online fiddler.

    Steps to reproduce:

    1. Generate your multilevel object from the form data. 1.1 I used a custom function, which could be implemented in this plugin.
    2. Send it via $('form').ajaxSubmit method.
    3. Ta-dam!

    I will try to improve this issue description as long as I have more time to write. TA.

    help wanted question need more info 
    opened by odahcam 10
  • IE8 ajaxForm issue. Incorrectly collect form data

    IE8 ajaxForm issue. Incorrectly collect form data

    I'm using ajaxForm and has no data in request. I got around the problem code modifying:

    in _formToArray function replaced

    if ( els ) {
            els = $(els).get();  // convert to standard array
        }
    

    by new code:

    if (els && !/MSIE 8/.test(navigator.userAgent)) {
            els = $(els).get();  // convert to standard array
        }
    
    opened by monco83 10
  • ajaxForm + IE8 + Redirect in postresult = IE8 hang

    ajaxForm + IE8 + Redirect in postresult = IE8 hang

    We use the jQuery.ajaxForm plugin to add products to a cart. As far as I understand it creates an iframe and posts the information.

    This goes well, but when a product is succesfully added to the cart, the system redirects to the success page. When the redirect happens, IE8 crashes.

    When there is an error while posting the form (the product isn't in stock any more) the pages doesn't redirect and just shows the error, IE8 doesn't crash.

    The software ran fine for a looong time, but it suddenly stopped working. Since IE8 crashes it is impossible to debug. The crash is triggered by the ajaxForm module because every other post works, every other ajax thingy work, normal ajaxForms works but ajaxForm+Redirect = IE8 Crash.

    Any idea what is going on?

    opened by paales 10
  • TagName in Element Undefined

    TagName in Element Undefined

    Hallo!

    If in this function it finds an element without tagName it gives an error for being undefined.

    $.fn.resetForm = function() {
    	return this.each(function() {
    		var el = $(this);
    		**var tag = this.tagName;**
    

    I believe that it can happen in other places that also use tagName.

    Greetings

    opened by Davmachuca 0
  • Improve jQuery 3 compatibility

    Improve jQuery 3 compatibility

    Hi there 👋

    This PR mainly changes some jQuery deprecated methods to their respective native methods. It also fixes an element selector.

    These changes will help with the purpose of being compatible with jQuery 3 as it has been tracked on #544.

    By the way, I also did run the tests and all of them had the green check 😄

    opened by xaabi6 0
  • Data Process Display in Progress

    Data Process Display in Progress

    Hello,

    Currently I use the "uploadProgress" method to inform the progress of the file upload, bringing data such as size and percentage sent to the server.

    But I would like to know if it would be possible to obtain this data for the creation of a progress bar but using the missing time in the case of executing a PHP script.

    Example: I have a CSV file with N lines that need to be read and saved in the DB, I would like to create a progress bar with the time remaining to complete this task.

    Would it be possible?

    If not, any ideas on how to inform the user how much it would take to complete this task?

    Thanks

    opened by garbinmarcelo 1
  • "data" option not sending through arrays

    Description:

    Hi

    I am appending data to the ajax form when constructing the options object, The data I am appending is an array or object, which is linked to a key in the data object,

    Expected Behavior:

    The appended array or object used with the "data" property in the form options gets sent through to the backend.

    Actual behavior:

    This only works in some cases. If I append a string, the values go through fine, The issue seems to only occur with arrays and objects.

    For example:

    var formOptions = { beforeSubmit: validateRequest, // pre-submit callback success: showResponse, // post-submit callback error: showError, dataType: "json", data: {chosenPos : selectedPos, chosenNotifs : selectedNotifs}, resetForm: false, } selectedPos and selectedNotifs are arrays or objects with global scope. This has worked before, but for some reason now does not seem to. It is not consistent.

    Thanks for the great library!

    Versions:

    jquery-form: 4.3.0 jQuery: 3.5.1

    opened by amhassen97 0
  • Feature Request: onReady event

    Feature Request: onReady event

    Description:

    Can you please add a callback when the ajaxForm finished binding the events to the real form? I have a case which a modal dialog is getting the html markup from the server and only then binding the ajaxform, and I want to show the submit button only after I'm sure the form has been set to fire via ajax

    opened by Binternet 0
Releases(v4.3.0)
  • v4.3.0(Jun 7, 2020)

  • v4.2.2(Aug 9, 2017)

    Changes

    1. 0762c5b #530 Updates license to use "LGPLv2.1 (or later) or MIT"
      Clarifies that either LGPLv2.1 (or later) or MIT license may be used.
    Source code(tar.gz)
    Source code(zip)
  • v4.2.1(Mar 29, 2017)

    Bug Fixes

    1. 12b358a #521 Replace serialized "+" with space
      This fixes/reverts a serious regression introduced by #262
      Thanks to @markcarver for the fix
    Source code(tar.gz)
    Source code(zip)
  • v4.2.0(Mar 19, 2017)

    News

    jQuery Form is confirmed to be compatible with jQuery 2 and 3! 🎉 If you see any incompatibilities, please report a bug or, preferrably, a pull request.

    New Features

    1. 55fba84 #486 Adds method option for API compatibility with newer versions of jQuery

    Bug Fixes

    1. 8434a5f #495 Makes ajaxSubmit with 'target' option compatible with jQuery>=1.12.1
    Source code(tar.gz)
    Source code(zip)
  • v4.1.0(Mar 9, 2017)

    New Features

    1. #436 Allows formToArray and ajaxSubmit to work on non-form tags
    2. #158 #421 #516 #517 When serializing text, encode all line breaks as CRLF pairs per the
      application/x-www-form-urlencoded specification
    3. 76a0b2a #450 #502 Updates AMD definition and adds CommonJS support
    4. Moves documentation from malsup.com to GitHub Pages
    5. Adds automated testing using ESLint, Grunt, Mocha, Chai, and PhantomJS

    Bug Fixes

    1. 76c7c90 #461 Outside fields bug fix prevents fields from being doubled in non-IE browsers
    2. #518 #258 IE fix if form is in a different document
    Source code(tar.gz)
    Source code(zip)
  • v4.0.1(Feb 21, 2017)

  • v4.0.0(Feb 20, 2017)

    News

    1. jQuery Form has a new home! The new canonical URL for the project is https://github.com/jquery-form/form
    2. The major version has been incremented to 4 due to the new home of project. Version 4 is expected to be backward compatible with 3.51.0.

    New Features

    1. aac6154 Contributor Code of Conduct
    2. #504 Changes functions 'bind' and 'unbind' to 'on' and 'off' for modern jQuery compatibility
    3. #193 Improve resetForm to work on individual elements and non-FORM tags
    4. #224 Adds a filtering function to remove some elements from being serialized
    5. #262 Added support for functions in 'data' option for ajaxForm and ajaxSubmit
    6. #400 Shorter plugin initialization and set reset/clear form options through data attributes
    7. #414 #463 options.success may be an array of callback functions
    8. #506 beforeSubmit event can abort the submit
    9. 0dc9b4e 2ea3e86 Updated compatibility with package managers
    10. aeb407d Grunt support

    Bug Fixes

    1. #446 Array conversion in IE8
    2. #469 Sometimes submit button is not found
    3. #471 Forms without a submit button
    4. #511 Disabled selects are no longer serialized
    Source code(tar.gz)
    Source code(zip)
:credit_card: make your credit card form better in one line of code

Card - check out the demo A better credit card form in one line of code Card will take any credit card form and make it the best part of the checkout

Jesse Pollak 11.5k Jan 4, 2023
A jQuery UI plugin to handle multi-tag fields as well as tag suggestions/autocomplete.

Tag-it: a jQuery UI plugin Tag-it is a simple and configurable tag editing widget with autocomplete support. Homepage Demo Check the examples.html for

Alex Ehlke 2.5k Dec 20, 2022
Magically convert a simple text input into a cool tag list with this jQuery plugin.

jQuery Tags Input Plugin Do you use tags to organize content on your site? This plugin will turn your boring tag list into a magical input that turns

XOXCO 2.3k Dec 23, 2022
jQuery plugin for styling checkboxes and radio-buttons

English description | Описание на русском jQuery-plugin for styling checkboxes and radio-buttons. With skin support. Version: 2.0.0 Project page and d

Denis Ineshin 70 Sep 24, 2022
Simple-load-more - This jQuery function will add a functionality to load 5 (or custom) more items. No AJAX functionality.

Simple Load More This jQuery plugin will add a functionality to load 5 (or custom) more items. Best for lists that are long and you want to hide all e

Zeshan Ahmed 28 Jan 4, 2023
:fire::fire::fire: 强大的动态表单生成器|form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions through JSON.

form-create form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions thr

xaboy 4.6k Jan 3, 2023
This Login Form made using React hooks , React Js , Css, Json. This form have 3 inputs, it also validate those inputs & it also having length limitations.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Yogesh Sharma 0 Jan 3, 2022
Auth-Form-Design - Beautiful Auth Form Designed using React 🥰.

?? Auth Form Design ?? Features 1. Check Your Password Strength 2. Can Use Suggested Password 3. Enjoy Responsive Design Getting Started with Create R

Samarpan Dasgupta 2 Dec 24, 2022
Gatsby-Formik-contact-form-with-backend-panel - Full working contact form with backend GUI panel.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
A Google Chrome extension that automatically fills in the "CAPTCHA" form element for IISER Pune's SAM portal (Academic ERP) login form

A Google Chrome extension that automatically fills in the "CAPTCHA" form element for IISER Pune's SAM portal (Academic ERP) login form.

Jason 3 Mar 4, 2022
This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

HtmlFormApp Overview This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreads

Kanshi TANAIKE 18 Oct 23, 2022
FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection.

FormGear is a framework engine for dynamic form creation and complex form processing and validation for data collection. It is designed to work across

Ignatius Aditya Setyadi 91 Dec 27, 2022
A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again.

form-storage A JavaScript library stores the form-data to the localstorage so you don't have to fill the form again. Installation via npm npm install

appleple 159 Dec 10, 2022
jQuery Form Plugin

jQuery Form Overview The jQuery Form Plugin allows you to easily and unobtrusively upgrade HTML forms to use AJAX. The main methods, ajaxForm and ajax

null 5.2k Jan 3, 2023
The best @jquery plugin to validate form fields. Designed to use with Bootstrap + Zurb Foundation + Pure + SemanticUI + UIKit + Your own frameworks.

FormValidation - Download http://formvalidation.io - The best jQuery plugin to validate form fields, designed to use with: Bootstrap Foundation Pure S

FormValidation 2.8k Mar 29, 2021
jQuery form validation plugin

jQuery.validationEngine v3.1.0 Looking for official contributors This project has now been going on for more than 7 years, right now I only maintain t

Cedric Dugas 2.6k Dec 23, 2022
A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes!

(jQuery) Uniform A jQuery plugin to make your form controls look how you want them to. Now with HTML-5 attributes! Works well with jQuery 1.6+, but we

Audith Softworks 2.2k Jan 2, 2023
The jQuery plugin for validation and post form data to server

NiceForm The jQuery plugin for validation and post form data to server (http://ducdhm.github.io/jquery.niceform/) Shortcuts Dependencies Rules Configu

Duc Doan (Bobby) 17 Jul 27, 2022
HTML 5 & Bootstrap Jquery Form Validation Plugin

HTML 5 & Bootstrap Jquery Form Validation Plugin HTML 5 & Bootstrap 5 & Jquery 3 jbvalidator is a fresh new jQuery based form validation plugin that i

null 37 Dec 6, 2022