New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "jquery.form" plugin #231

Closed
niceue opened this Issue May 9, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@niceue
Copy link
Owner

niceue commented May 9, 2016

Way 1: use .ajaxForm() directly

$('#form1').ajaxForm({
    url: 'http://www.mocky.io/v2/5703d5b52700006b2606b00e',
    success: function(d) {
        alert(d.message)
    }
});

Way 2: use .ajaxSubmit() after valid form

// use 'valid.form' event
$('#form1').on('valid.form', function(){
   $(this).ajaxSubmit({
        url: 'http://www.mocky.io/v2/5703d5b52700006b2606b00e',
        success: function(d) {
            alert(d.message)
        }
    });
});

// use valid callback
$('#form1').validator({
    valid: function(){
        $(this).ajaxSubmit({
            url: 'http://www.mocky.io/v2/5703d5b52700006b2606b00e',
            success: function(d) {
                alert(d.message)
            }
        });
    }
});

@niceue niceue added the new label May 9, 2016

@niceue niceue added this to the 1.0.0 milestone May 9, 2016

niceue referenced this issue May 9, 2016

@niceue niceue closed this May 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment