Apply

jQuery('#viz-ajax-contact-form').on('submit', function (e) { e.preventDefault(); jQuery('#viz-form-submit').attr('disabled', true); jQuery('#viz-form-submit').text('Sender...'); jQuery.ajax({ type: 'POST', url: '/wp-content/themes/divi-child-theme/upload.php', data: new FormData(this), dataType: 'json', contentType: false, cache: false, processData: false, success: function (data) { var res = data; if (res.status) { jQuery('#viz-ajax-contact-form').trigger('reset'); jQuery('#viz-form-submit').attr('disabled', false); } if (res.errors && res.errors.length > 0) { for (var i = 0; i jQuery('#response-errors').append( '
  • ' + res.errors[i] + '
  • ' ); } } jQuery('#response-message').text(res.message); jQuery('#viz-form-submit').text('Send besked'); }, error: function (request, status, error) { jQuery('#viz-form-submit').attr('disabled', false); jQuery('#viz-form-submit').text('Send besked'); }, }); });