- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 04:57 AM
I have a requirement to unlock the URL field on form load in portal. I tried using https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0815270. But click function is throwing Javascript console error. I need this requirement only for one catalog item. Is there a way to unlock URL field in portal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:25 AM
this worked for me in portal; I hope you can enhance it further as per your requirement
Ensure you keep Isolate Script= False for your onLoad catalog client script and set UI Type= Portal
function onLoad() {
setTimeout(function() {
var variableName = "my_url"; // give your variable name here
var inputTag = this.document.getElementById("sp_formfield_" + variableName + "_unlock");
inputTag.click();
}, 3000);
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2024 05:25 AM
this worked for me in portal; I hope you can enhance it further as per your requirement
Ensure you keep Isolate Script= False for your onLoad catalog client script and set UI Type= Portal
function onLoad() {
setTimeout(function() {
var variableName = "my_url"; // give your variable name here
var inputTag = this.document.getElementById("sp_formfield_" + variableName + "_unlock");
inputTag.click();
}, 3000);
}
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader