Page 1 of 1

Hyperlink control, how to set parameters via code

Posted: 31 Aug 2017
by AlexStenAlexSten
hello,
I'd need to use a hyperlink control on a form and set the url (Href...) via javascript, based on the ID of the current item.
2017-08-31 12_25_11-Forms Designer - Internet Explorer.png
2017-08-31 12_25_11-Forms Designer - Internet Explorer.png (43.83 KiB) Viewed 1861 times
Can you help me to understand, how to modify the hyperlink control settings please?

thank you

Re: Hyperlink control, how to set parameters via code

Posted: 31 Aug 2017
by Nikita Kurguzov
Hello, Alex!
You can use JQuery to change href attribute of the link control. Give the link a class and then use this code:

Code: Select all

$(".myURL").attr("href", "http://www.website.com/");

Re: Hyperlink control, how to set parameters via code

Posted: 31 Aug 2017
by AlexStenAlexSten
thanks a lot Nikita!
will try it immediately.

Cheers

Re: Hyperlink control, how to set parameters via code

Posted: 11 Dec 2017
by Cloud.Ed
Can you set href attribute to open in a new tab?

Thanks!

Re: Hyperlink control, how to set parameters via code

Posted: 11 Dec 2017
by Cloud.Ed
I found the answer, just the correct attribute like

$(".myURL").attr("target", "_blank");

Re: Hyperlink control, how to set parameters via code

Posted: 12 Dec 2017
by Nikita Kurguzov
Hello, Cloud.Ed!
Okay, great to hear that! Yes, it's a simple JQuery command to change target attribute and it should work rather straight-forward.
If you do encounter any issues in the future or have any questions - please, let us know.