function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ISVforce PartnerISVforce Partner 

Javascript does not work if VF is rendered as PDF

I am sure I am not the first one to encounter this. Has anyone worked with JS and VF (RenderAs="PDF") ?? 


I need to have  "Do you want to save this PDF to the Quote?" confirm dialog when user closes the window. For some reason, JS is not called when page is rendered as PDF. If I remove renderas"pdf" attribute from the page, it shows the popup. 


PDF cannot have alert just by nature of it, but is that true for VF pages rendered as PDF? Is there any work around?


Thanks for your time. 



Maros SitkoMaros Sitko

PDF doesn't work with JS, you need build some button, which create pdf and add it to your record as attachment