Skip to content

A jQuery plugin for asynchronous forms, handles uploads and will soon handle clientside validation as well

Notifications You must be signed in to change notification settings

Mat-thieu/Asyncform-jQuery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Asyncform-jQuery (indev)

A jQuery plugin for asynchronous forms, handles uploads and will soon handle clientside validation as well

I will post the documentation here at a later point, for now you can read the docs here

Example code

$('#formy').asyncform({
    finalize: 'summarize',// Summarize, log, redirect(URL=http://example.com), serverResponse
    output: '#output',
    onSubmit: function(form){
        $(form['inputs']).prop('disabled', true);
    },
    onUpload: {
        start : function(){
            $('.progress').slideDown(500);
        },
        progress : function(progress){
            var strippedPercentage = parseInt(progress['percentage']);
            $('#formProg').html(strippedPercentage+'%').attr('aria-valuenow', strippedPercentage).css('width', strippedPercentage+'%');
        }
    },
    onSuccess: function(response){
        $('#formProg').html('Done!');
        $(response['inputs']).prop('disabled', false);
        $('.progress').delay(500).slideUp(500);
    },
    onFail: function(err){
        alert('An error has occured, please try again.');
        console.log(err);
    }
});

About

A jQuery plugin for asynchronous forms, handles uploads and will soon handle clientside validation as well

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published