Use file-input-change event to disable/enable conversionType

This commit is contained in:
Omar Ahmed Hassan 2024-12-17 01:00:21 +02:00
parent e273b9a3ad
commit 64ee26facf
No known key found for this signature in database
GPG Key ID: ABE806D1E7CA21AE

View File

@ -51,15 +51,11 @@
<br>
<button type="submit" id="submitBtn" class="btn btn-primary" th:text="#{imageToPDF.submit}"></button>
<script>
$('#fileInput-input').on('change', function() {
$('#fileInput-input').on('file-input-change', () => {
var files = document.getElementById("fileInput-input").files;
var conversionType = document.getElementById("conversionType");
console.log("files.length=" + files.length)
if (files.length > 1) {
conversionType.disabled = false;
} else {
conversionType.disabled = true;
}
conversionType.disabled = files.length <= 1;
});
$('#conversionType').change(function() {