Need help in adding a link in String type field

Pihu1
Tera Contributor

Hi Community,

I need help in adding a link in String type field. How can we store a link/add a link in String type field ?

Any help would be greatly appreciated.

Thanks

Pihu

7 REPLIES 7

Not applicable
g_form.getControl('u_url').target = "_blank";  // open in new tab

Hi,

Can you please help with the field type.

Aditya_hublikar
Mega Sage

Hello @Pihu1 ,

 

Here it look like :

Aditya_hublikar_0-1781599309162.png

 

 

You can try this code snippet :

function onLoad() {
    var fieldName = 'u_incident'; 
    var placeholder = "##placeholder##";
    var url = "https://google.com"; /
    
   
    g_form.showFieldMsg(fieldName, placeholder, 'info', false);
    
 
    try {
        var elements = document.getElementsByClassName("fieldmsg notification notification-info");
        if(elements.length > 0) {
            var str = elements[0].innerHTML;
            str = str.substring(0, str.indexOf(placeholder));
            elements[0].innerHTML = str + 'Please <a href="' + url + '" target="_blank">click here</a> for more information.';
        }
    } catch(e) {
        // Fallback or error handling
    }
}

 

Note : uncheck isolated script 

 

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya