Add an URL to Alert or through addInfoMessage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 04:17 AM
Hi ,
I have to put some text and a URL link in an Alert box which is displayed on On Submit of a Catalog item.
I know that Alert box can only contain String not an URL. But URL can be displayed with addInfoMessage.
Now the issue is that the script works on Submit and so the message is displayed on Submit but in a second the page gets changed. Is there any way to Stop the page from changing or adding URL in Alert Box?
Thanks.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 04:30 AM
Alert does not support URL's, try using sweet alerts as a workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 04:49 AM
Hi,
You can add URL in addInfoMessage .
var url='URL to open';
var urlString = '<a class="web" target="_blank" href="' + url + '">' + Text to display + '</a>';
g_form.addInfoMessage(urlString);
Thanks,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2019 04:56 AM
HI RJ, I know that my question is that it is written on an On SUbmit script script, so message is displayed only for a second until page moves to next page. Is there a way to keep it on the same page for a few seconds?