i am trying to make the upload file input direction from bootstrap 4 right to left but nothing i tried so far worked
i also tried to change the direction for different tags
<div class="form-group">
<div class="col-md-4">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile" multiple lang="ar" dir="rtl">
<label class="custom-file-label text-left" for="customFile">choose files to upload</label>
</div>
</div>
<script type="text/javascript">
$('.custom-file input').change(function (e) {
var files = [];
for (var i = 0; i < $(this)[0].files.length; i++) {
files.push($(this)[0].files[i].name);
}
$(this).next('.custom-file-label').html(files.join(', '));
});
</script>
</div>
To create a custom file upload, wrap a container element with a class of . custom-file around the input with type="file". Then add the . custom-file-input to it.
Compose Bootstrap's custom file input with custom label. Hide default Choose file button with the ::file-selector-button pseudo-element. There are pseudo-elements ::-webkit-file-upload-button and ::-ms-browse for older versions of Chrome/Opera/Safari and Edge/IE respectively.
You would need a little custom CSS like this...
.custom-file-label::after {
left: 0;
right: auto;
border-left-width: 0;
border-right: inherit;
}
Demo: https://www.codeply.com/go/kOURGBHqEX
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With