Display hyperlink on form

Rj27
Mega Guru

Hi ,

I need to display a hyperlink on my form.
Currently the field is displaying entire url.
How can i display the hyperlink without DOM manipulation ?

My current ui policy script :
var message = "Click me!";
document.getElementById("<table_name>.<field_name>_link").innerHTML = message;

 

I am working in scoped application. The code above is working fine in global but not in scoped.

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@Rj27 

for DOM manipulation to work fine in scoped app you need to ensure that Isolate script field for your client script is marked as False

Also check this blog

Client-side global JavaScript objects in scoped applications 

Isolate Script in London 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,
I don't want to use DOM manipulation. Is there any other alternative to display hyperlink ?

@Rj27 

you can use annotation and show the link if the link will always be static.

you can also use g_form.addInfoMessage() to show hyper links on form

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

My link is dynamic.
also, i don't want to display as info message.
This is how it is looking in global.

Rj27_0-1685346470897.png