Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $js2 = <<<JS
- $('body').on('beforeSubmit', 'form#dynamic-form', function () {
- // submit form
- console.log('starting ajax request');
- $.ajax({
- xhr: function() {
- var xhr = new window.XMLHttpRequest();
- xhr.addEventListener('progress', function(e) {
- if (e.lengthComputable) {
- $('.progress-bar').css('width', (100 * e.loaded / e.total) + '%').attr( "aria-valuenow", (100 * e.loaded / e.total));
- }
- });
- return xhr;
- },
- url: form.attr('action'),
- type: 'post',
- data: {id : $('#dynamicmodel-nomor_coil').val()}, // nomor coil digunakan sebagai ID
- dataType : 'json',
- success: function (response, status, xhr) {
- },
- complete: function(response, status, xhr){
- $('.progress-bar').css('width','0%').attr( "aria-valuenow", "0");
- return xhr;
- }
- }).done(function() {
- jQuery('#dynamicmodel-nomor_coil').prop('disabled', false);
- });
- return false;
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement