- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 02:36 AM
I have created a "rich text field" called "click here to download requisition form". it is suppose to download a pdf file.
But before downloading it is giving me this popup to leave site. when i click on leave the pdf is getting downloaded and when i click on cancel its not getting downloaded.
How to remove this popup and let the user download pdf as soon as they click on the variable.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 03:15 AM
Hi @NiloferS
Setting the Open Link in New Window should do the trick.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 02:46 AM
Hi @NiloferS ,
Found a step by step resolution to this, try it and see if it helps:
To resolve this issue and ensure that the PDF is downloaded directly when clicking on the rich text field without showing the "leave site" popup, you can use JavaScript to handle the click event and trigger the download. Here's a step-by-step guide on how to do it:
Step 1: Host the PDF File
Ensure the PDF file is hosted on a server that you can access via a direct URL.
Step 2: Create a UI Script
- Navigate to System UI > UI Scripts.
- Click on "New" to create a new UI Script.
- Name the script appropriately, e.g., "Download PDF Script".
- In the Script field, add the following JavaScript code:
function downloadPDF(url) {
var link = document.createElement('a');
link.href = url;
link.download = url.substring(url.lastIndexOf('/') + 1);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
- Save the UI Script.
Step 3: Add the Rich Text Field
When creating or editing the form containing the rich text field, add the following HTML with an onclick event that calls the downloadPDF function:
<a href="#" onclick="downloadPDF('https://example.com/path/to/your/file.pdf'); return false;">Click here to download requisition form</a>
Replace https://example.com/path/to/your/file.pdf with the actual URL of your PDF file.
Thanks.
Hope this helps.
If my response turns useful, mark it helpful and accept solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 02:48 AM
@NiloferS In your hyperlink please add the target attribute as _blank. Here is an example of the sample link
<a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a>
Please mark the response helpful and accepted solution if it manages to address your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2024 03:15 AM
Hi @NiloferS
Setting the Open Link in New Window should do the trick.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 03:58 AM
Hi @Amit Verma
Could you please let us know where exactly we can set this Open link in... drop down.