Title: Adding custom Javascript functions
Last modified: August 21, 2016

---

# Adding custom Javascript functions

 *  Resolved [noskcaja](https://wordpress.org/support/users/noskcaja/)
 * (@noskcaja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-custom-javascript-functions/)
 * Hi there,
 * Great plugin, love the functionality. I’m currently a newbie on both WP & associated
   plugins so please excuse any basic questions.
 * So, I have a great looking form and one issue that I can’t seem to solve. I need
   to be able to show an appointment booking time in the user’s local time compared
   to that of the one booked in GMT.
 * I’ve created the code to calculate the difference and can display that easily
   enough but I can’t seem to find a way to hook it in to a Date field and the Time
   fields. Ideally I’d like the little script to fire when “onchange” is detected
   for any named Date & Time field.
 * I’m sure there must be a right way and a wrong way to do this … I could edit 
   the form-output.php and add an onchange there but that seems really prone to 
   change control and must be the wrong way.
 * My lack of knowledge on the functionality here is letting me down so any pointers
   on how to add a listener and incorporate some custom JS would be very much appreciated.
 * Cheers
    Andrew
 * [https://wordpress.org/plugins/visual-form-builder/](https://wordpress.org/plugins/visual-form-builder/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [noskcaja](https://wordpress.org/support/users/noskcaja/)
 * (@noskcaja)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/adding-custom-javascript-functions/#post-4724367)
 * OK, so I’ve added a listener in my sidebar just encapsulating it in `<script>...
   </script>` and it’s firing as required. Sorry to have asked before playing a 
   bit more.
 * Cheers
    Andrew

Viewing 1 replies (of 1 total)

The topic ‘Adding custom Javascript functions’ is closed to new replies.

 * ![](https://ps.w.org/visual-form-builder/assets/icon-256x256.png?rev=1205840)
 * [Visual Form Builder](https://wordpress.org/plugins/visual-form-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visual-form-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visual-form-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/visual-form-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visual-form-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visual-form-builder/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [noskcaja](https://wordpress.org/support/users/noskcaja/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/adding-custom-javascript-functions/#post-4724367)
 * Status: resolved