unlock URL field

Suraj kumar
Kilo Contributor

Hi All,

I am trying to unlock URL field but i am not able to do.

I wrote onLoad() client script 

Table name: u_documents

Field name: u_url

var data = g_form.getValue('u_url');
var unlockControl = g_form.getControl('u_url_unlock');
alert(unlockControl);
//Set its onclick method

unlockControl.onclick = unlockClick;
alert(unlockControl.onclick);
}

function unlockClick() {
g_form.setDisplay('short_description', false);
unlock(this, 'u_documents.u_url','u_documents.u_url_edit', 'u_documents.u_url_nonedit');
}

But this one not working.

Please help.

 

Thanks in advance

 

2 REPLIES 2

sachin_namjoshi
Kilo Patron
Kilo Patron

Please go to the 'System Properties' -> 'UI Properties' and find the below to Check the check box.

 

'Unlock empty URL fields on form load' (glide.ui.unlock_empty_url) â€” Controls the default lock behavior of all empty URL fields on form load.

 

 

 

Useful Link: Lock/Unlock glide_list and URL Fields With Client Scripts - ServiceNow Guru

 

Regards,

Sachin

Hi Sachin,

 

I am quite new in servicenow.

Thank you for your reply but as i know when i go through 'System Properties' -> 'UI Properties' then this apply for all.

But i want only for my table " u_documents".

I wrote this piece of logic in client script and this work but now i got one more new issue.

unlock(this, 'u_documents.u_url', 'u_documents.u_url', 'u_documents.u_url_link');

 

When i use this then it able to unlock url but on page it will show 2 icon.

As you can see in this attachment.