Hi Bubble Forum, The input field “Accepted file types” is missing in the element’s properties panel, so I cannot set client-side validation for file formats. I have confirmed I am on the latest version of the plugin. Could you please advise? This is a critical feature for my app.
I believe adding custom JS via the HTML element should work for you?
Something like:
// Get the file input element (replace ‘your-file-input-id’ with actual ID)
const fileInput = document.querySelector(‘input[type=“file”]’);
if (fileInput) {fileInput.addEventListener(‘change’, function(e) {const file = e.target.files[0];
// Define allowed file types
const allowedTypes = ['.pdf', '.jpg', '.jpeg', '.png', '.doc', '.docx'];
if (file) {
const fileName = file.name.toLowerCase();
const isAllowed = allowedTypes.some(type => fileName.endsWith(type));
if (!isAllowed) {
alert('File type not allowed. Please upload: ' + allowedTypes.join(', '));
e.target.value = ''; // Clear the input
return false;
}
}
});
}
