I want to put a link to an error message on a catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 07:11 PM
When displaying an error message in a catalog item,
How do I embed a link in the error message?
The following code will display the error message.
Is there a best practice?
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 08:56 PM
Hi,
In the label variable, there is an option to link the text. Please try it.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 10:18 PM
Thanks for the answer!
Is there any way to link to the error message instead of the label variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 10:27 PM
Hi @arai keigo ,
I trust you are doing great.
Here's an example of how you can embed a link in the error message using JavaScript code:
var link = '<a href="https://www.yahoo.co.jp/">Download Template</a>';
g_form.addErrorMessage(link);
In this code, the link variable contains the HTML markup for the link. The href attribute specifies the URL that the link should navigate to, and the link text is displayed as "Download Template." The addErrorMessage() function is then used to display the error message on the catalog item form.
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2023 10:50 PM