Skip to content

Instantly share code, notes, and snippets.

@devstar0209
Created March 13, 2024 11:58
Show Gist options
  • Save devstar0209/ffd5012068f6a266879cd7c4e635190e to your computer and use it in GitHub Desktop.
Save devstar0209/ffd5012068f6a266879cd7c4e635190e to your computer and use it in GitHub Desktop.
Customize file input
<div class="form-control d-flex justify-content-between align-items-center">
<input hidden type="file" accept=".pdf,.png,.jpeg,.jpg" name="bankFile" id="bankFile" class="form-control" required>
<p>{{__('BANK ac proof')}}</p>
<label for="bankFile" class="btn btn-light btn-sm">Upload</label>
</div>
<script>
$('input[type="file"]').on('change', function() {
$(this).next().html($(this).val().split("\\").splice(-1,1)[0] || "Select file");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment