Title: Adding JavaScript to Success Message
Last modified: March 14, 2018

---

# Adding JavaScript to Success Message

 *  [InterlockSolutions](https://wordpress.org/support/users/interlocksolutions/)
 * (@interlocksolutions)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/adding-javascript-to-success-message/)
 * Hi there,
 * I’m using the “salesforce_w2l_success_message_[form id]” hook to tweak the success
   message that is displayed after a specific form is completed. I need to add some
   JavaScript to the message so a PDF document is popped in a new window along with
   the thank you message.
 * When I add the JavaScript code using this hook, the text is filtered before being
   displayed on the screen, and the JavaScript doesn’t run — it’s simply displayed
   on the screen since the “<” gets turned to “lt;”. How can I get the hook function’s
   output to allow JavaScript code to be run?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Nick Ciske](https://wordpress.org/support/users/nickciske/)
 * (@nickciske)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/adding-javascript-to-success-message/#post-10142128)
 * You can’t, at present. It’s escaped to as that’s intended to be a message, not
   code.
 * I’ll add a success JS option in the next release (no ETA yet).

Viewing 1 replies (of 1 total)

The topic ‘Adding JavaScript to Success Message’ is closed to new replies.

 * ![](https://ps.w.org/salesforce-wordpress-to-lead/assets/icon-256x256.png?rev
   =2316786)
 * [Brilliant Web-to-Lead for Salesforce](https://wordpress.org/plugins/salesforce-wordpress-to-lead/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/salesforce-wordpress-to-lead/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/salesforce-wordpress-to-lead/)
 * [Active Topics](https://wordpress.org/support/plugin/salesforce-wordpress-to-lead/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/salesforce-wordpress-to-lead/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/salesforce-wordpress-to-lead/reviews/)

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 1 reply
 * 2 participants
 * Last reply from: [Nick Ciske](https://wordpress.org/support/users/nickciske/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/adding-javascript-to-success-message/#post-10142128)
 * Status: not a support question