Jump to content

Hide "No File Chosen" on tabular report

Recommended Posts

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:


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})

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

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...