Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Reference field read only issue in ui page

Prem13
Tera Contributor

I Created a reference field and a check box in ui page

on load of the ui page the "reference field" is read only but though it is read only i can select the reference field value

how can i avoid that.

HTML:
 <label style="margin-right:8px; font-size:12px;">User</label> <input type="checkbox" id="usercheckbox" /> $[SP]$[SP]
   <g:ui_reference name="user" id="user"  table="sys_user" />

client script:
gel("sys_display.user").readOnly=true;

usercheckbox.addEventListener("change", function() {
    if (gel("usercheckbox").checked) {

     gel("sys_display.user").readOnly=false;
     
    }
	else
		{
			 gel("sys_display.user").readOnly=true;
		}
});

Below is the image though its readonly i was able to select the search icon to select the user

find_real_file.png

 

 

1 ACCEPTED SOLUTION

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

 

You have to hide the look as well. So use this code as well:

gel("sys_display.user").readOnly=true;

document.getElementById('lookup.user').style.visibility="hidden";

 

So this will make field readonly and hide the reference icon.

 

Thanks,
Ashutosh

View solution in original post

2 REPLIES 2

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

 

You have to hide the look as well. So use this code as well:

gel("sys_display.user").readOnly=true;

document.getElementById('lookup.user').style.visibility="hidden";

 

So this will make field readonly and hide the reference icon.

 

Thanks,
Ashutosh

Ash10Patil
Kilo Guru

Hi,

 

You can use below line to disable glass icon(anchor tag)

gel("lookup.user").style="pointer-events: none;"

 

Enable glass icon(anchor tag)

gel("lookup.user").style="";

 

Thanks.