file-upload.js 398 B

123456789101112
  1. (function($) {
  2. 'use strict';
  3. $(function() {
  4. $('.file-upload-browse').on('click', function() {
  5. var file = $(this).parent().parent().parent().find('.file-upload-default');
  6. file.trigger('click');
  7. });
  8. $('.file-upload-default').on('change', function() {
  9. $(this).parent().find('.form-control').val($(this).val().replace(/C:\\fakepath\\/i, ''));
  10. });
  11. });
  12. })(jQuery);