adding a hyperlink in client script

swarnargha1
Giga Contributor

Hi,

I have written a client script.

find_real_file.png

I want to add youtube link in the short description and add a <name> in it.

So, when i click on hyperlink it will rediredt to youtube and when i click on <name> it will get redirect to my user account.

SHort description should be " user has selected walk in <youtube link> <name of my profile>

Please help!!

5 REPLIES 5

Deepak Kumar5
Kilo Sage

Short description is of string and will not contain hyperlink in it.


You have to create UI macro for adding link in form.


rajeevlochan82
Mega Guru

The Kind of functionality you are looking for does not seem to be possible in Short Description field as its of type string. You have to create a field type of HTML which you can then populate using your client script. You can use anchor / uri tags in that html field type.



If you just need to store a clickable URL then you can create field of type URL



find_real_file.png


Hi Swarna,



The scenario described by Rajeev meets your requirement.



Thanks


Priyanka


arnabwa
Giga Guru

Hi Swarna,



You can create this link via UI Page type variable and then manipulate it via Client script. Take a look :



You could try the UI Page solution. It works really fine for me. Here is the process :


  1. Make a UI Page (according to your requirements) with the following code in the HTML scripting section :


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<h5><b>                                                                          


  $[SP]$[SP]$[SP]<font color = 'black'>User has selected walk in$[SP]</font><u>


  <a href="https://link to you tube" target="_blank"><font color = 'blue'>You Tube</font></a></u>


  $[SP]$[SP]<u>


  <a href="https://link to your profile" target="_blank"><font color = 'blue'>$[SP]Swarna</font></a></u>


</b></h5>


</j:jelly>



2. Make a variable in the form of Type = 'UI Page'


3. While making the variable you will see a field named 'UI page'. Select the name of the above UI Page you have just made.


Now you are able to see the link on the form with your desired requirement.



Let me know if you need further assisstance.



Thanks,


Arnab.