Skip to content

Instantly share code, notes, and snippets.

@jmarnold
Created January 8, 2012 04:35
Show Gist options
  • Save jmarnold/1577221 to your computer and use it in GitHub Desktop.
Save jmarnold/1577221 to your computer and use it in GitHub Desktop.
This one's for Alex
$(document).ready(function() {
var preview = $('#mainForm').data('validation-preview');
$(':input', '#mainForm').change(function() {
$.ajax({
type: 'POST',
data: $('#mainForm').formSerialize(),
url: preview,
beforeSend: function(xhr) {
this.correlationId = 'mainForm';
$.continuations.setupRequest.call(this, xhr);
}
});
});
$('#mainForm').submit(function() {
$(this).correlatedSubmit();
return false;
});
});
@ahjohannessen
Copy link

cool :)

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