custom language message is added noFileSelected

This commit is contained in:
saikumarjetti 2025-03-28 00:29:14 +05:30
parent 7bbf732cd4
commit bd46afcd84
4 changed files with 6 additions and 3 deletions

View File

@ -83,6 +83,7 @@ loading=Loading...
addToDoc=Add to Document
reset=Reset
apply=Apply
noFileSelected=No file selected. Please upload one.
legal.privacy=Privacy Policy
legal.terms=Terms and Conditions

View File

@ -83,6 +83,7 @@ loading=Loading...
addToDoc=Add to Document
reset=Reset
apply=Apply
noFileSelected=No file selected. Please upload one.
legal.privacy=Privacy Policy
legal.terms=Terms and Conditions

View File

@ -35,6 +35,7 @@ function setupFileInput(chooser) {
const pdfPrompt = chooser.getAttribute('data-bs-pdf-prompt');
const inputContainerId = chooser.getAttribute('data-bs-element-container-id');
const showUploads = chooser.getAttribute('data-bs-show-uploads') === "true";
const noFileSelectedPrompt = chooser.getAttribute('data-bs-no-file-selected');
let inputContainer = document.getElementById(inputContainerId);
const input = document.getElementById(elementId);
@ -61,7 +62,7 @@ function setupFileInput(chooser) {
// Handle form validation if the input is left empty
input.addEventListener("invalid", (e) => {
e.preventDefault();
alert(pdfPrompt);
alert(noFileSelectedPrompt);
});
const dragenterListener = function () {

View File

@ -228,7 +228,7 @@
loading: '[[#{loading}]]'
};</script>
<div class="custom-file-chooser mb-3"
th:attr="data-bs-unique-id=${name}, data-bs-element-id=${name+'-input'}, data-bs-element-container-id=${name+'-input-container'}, data-bs-show-uploads=${showUploads}, data-bs-files-selected=#{filesSelected}, data-bs-pdf-prompt=#{pdfPrompt}">
th:attr="data-bs-unique-id=${name}, data-bs-element-id=${name+'-input'}, data-bs-element-container-id=${name+'-input-container'}, data-bs-show-uploads=${showUploads}, data-bs-files-selected=#{filesSelected}, data-bs-pdf-prompt=#{pdfPrompt}, data-bs-no-file-selected=#{noFileSelected}">
<div class="mb-3 d-flex flex-row justify-content-center align-items-center flex-wrap input-container"
th:name="${name}+'-input'" th:id="${name}+'-input-container'" th:data-text="#{fileChooser.hoveredDragAndDrop}">
<label class="file-input-btn d-none">