Created
April 4, 2019 16:51
-
-
Save techbrownbags/bfc88ce89aa29f1a5c6b75e4da8199c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function() { | |
$('input#system_search_form_btn').on('click', function(e) { | |
// submits related form | |
}); | |
$('form#system_search_form').on('submit', function(e) { | |
e.preventDefault(); | |
$.ajax({ | |
type: $(this).attr('method'), | |
url: $(this).attr('action'), | |
data: $(this).serialize(), | |
beforeSend: function( xhr ) { | |
$('#loading').addClass('loading'); | |
} | |
}).done(function(response) { | |
$( '#systems_search_table' ).html( response ); | |
}).fail(function(response) { | |
}).always(function() { | |
$('#loading').removeClass('loading'); | |
}); | |
}); | |
$('input#system_search_form_btn').click(); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment