I am using Bootstrap v4.5.0 in a Django template (not sure if relevant). Specifically I am using Bootsrap form components (as per https://getbootstrap.com/docs/4.5/components/forms/) to display my form elements.
While I can use the form to select a file, and upload it fine, the form never updates to show that a file has been selected. This is a problem as I have had users think my web application is not accepting their files without reason.
I'm including all the JavaScript that would be needed, and I have tested in different browsers, so I am unsure what the problem is. I would prefer not to use a different version of Bootstap at this stage, and don't believe it is an issue with the version anyway.
I have attached a snippet demonstrating the issue:
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</head>
<body>
<div class="custom-file">
<input class="custom-file-input" id="customFile1" name="testfile" type="file" /><label class="custom-file-label" for="customFile1">Upload a file</label>
</div>
</body>
</html>
question from:
https://stackoverflow.com/questions/66056205/bootstrap-file-select-fields-not-updating-after-file-selected 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…