Title: inserting javascript variables into a calendar
Last modified: April 12, 2023

---

# inserting javascript variables into a calendar

 *  Resolved [wurwaldesign](https://wordpress.org/support/users/wurwaldesign/)
 * (@wurwaldesign)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/inserting-javascript-variables-into-a-calendar/)
 * Hi there,
 * I have inserted some add to calendar buttons into the gravity forms journey using
   an html block and it appears ok.
 * **<add-to-calendar-button name=”Session 1″ options=”‘Apple’,’Google'” location
   =”World Wide Web” startDate=”2023-04-16″ endDate=”2023-04-18″ startTime=”10:15″
   endTime=”23:30″ timeZone=”America/Los_Angeles” ></add-to-calendar-button>**
 * How would I go about inserting a javascript variable I create during the progression
   of a gravity form into the add to calendar markup?
 * For example if I wanted to insert a javascript variable for the ‘name’ parameter?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finserting-javascript-variables-into-a-calendar%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Add to Calendar](https://wordpress.org/support/users/add2cal/)
 * (@add2cal)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/inserting-javascript-variables-into-a-calendar/#post-16649909)
 * Generally, this would not be directly possible with the current solution. There
   is another setup in the making, which would enable you to create the button code
   on the backend side via API, but not sure if this would match your case either.
 * One would need to write an official add-on for the gravity form platform.
 * **What could work (experimental):**
    - Create the button and set something like id=”abc”.
    - In the JavaScript function, you want to create, identify that element on the
      page and rewrite the name=”xyz”.
    - When it gets rewritten, the button would automatically update.
 *  Plugin Author [Add to Calendar](https://wordpress.org/support/users/add2cal/)
 * (@add2cal)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/inserting-javascript-variables-into-a-calendar/#post-16703102)
 * Closing this for now, since (from a support perspective), this is more about 
   gravity forms than this plugin.
 * The mentioned approach should work. Besides that, maybe there is a better way
   like letting the user complete the journey and show the summary then. Maybe you
   are then able to retrieve the data first and already put it into the button code
   directly.
 * Anyway, we will try to offer more options in the near future to better support
   such cases. Stay tuned 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘inserting javascript variables into a calendar’ is closed to new replies.

 * ![](https://ps.w.org/add-to-calendar-button/assets/icon.svg?rev=2849393)
 * [Add to Calendar Button](https://wordpress.org/plugins/add-to-calendar-button/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-to-calendar-button/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-to-calendar-button/)
 * [Active Topics](https://wordpress.org/support/plugin/add-to-calendar-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-to-calendar-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-to-calendar-button/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Add to Calendar](https://wordpress.org/support/users/add2cal/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/inserting-javascript-variables-into-a-calendar/#post-16703102)
 * Status: resolved