Volomeister Posted November 30, 2022 Report Share Posted November 30, 2022 Hi there, I needed to hide "No File Chosen" when a file field is left blank. If the file is chose, the file name should be displayed Here is a solution I came up with: <script> if (typeof mainF=='undefined') { const hideInputText = (e) => { if (e.target.getAttribute('type')== "file") { if (e.target.files.length > 0) { e.target.style.color = 'black'} else { e.target.style.color = 'transparent'} } } const mainF = () => { document.querySelector('head').insertAdjacentHTML('beforeend', `<style> input.cbResultSetFile[type="file"] {color: transparent}</style>`) document.addEventListener('change', hideInputText, true) } document.addEventListener('DataPageReady', mainF, {once : true}) } </script> Just copy this code snippet to t he header or footer of your DataPage. This is how it will look after code is applied: I hope someone will find this useful Ilyrian 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.