Display text field value as link

I have a list of suppliers that contains various phone numbers and email addresses that I would like to be clickable. I am at a loss as to how to transform these text fields to display as hyperlinks and/or format them as "mailto:" or "tel:" a href's.

Hello @tmoreno,

Are you using List or Library control do display the list of supplier on a form?

Could you please share the form screenshot.

Hi @mnikitina,

Please find the screenshot below...

As you can see, the list is a list of suppliers- so the form is the details of a particular supplier. I'm trying to see if there's a way to present the details like phone number and email address as clickable links?

Thanks,

Tom

Hello @tmoreno,

You can use the code below to add links to field values:

fd.spRendered(function() {   
    var emal = fd.field('Email').value
    var phone = fd.field('Phone').value
    
    $(fd.field('Email').$el).html($("<a>").attr("href", "mailto:" + email).text(email));
    $(fd.field('Phone').$el).html($("<a>").attr("href", "tel:" + phone).text(phone));
});
1 Like

Amazing!! Thank you!

1 Like