Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript to Add to Calendar

Participant ,
Aug 29, 2018 Aug 29, 2018

I would like to add a button to my form that will allow the user to click and have the event information sent to their iCal - or any other calendar they may be using.

I'm not a Javascript expert. Here is some code I found - but it doesn't work.
If there is anyone out there who can help it will be greatly appreciated.

var cal = ics();

  cal.addEvent('Demo Event', 'This is an all day event', 'Port Elizabeth', '10/10/2018', '10/10/2018');

  cal.addEvent('Demo Event', 'This is thirty minute event', 'Port Elizabeth', '10/10/2018 5:30 pm', '10/10/2018 6:00 pm');

<a href="javascript:cal.download()">Test</a>

TOPICS
PDF forms
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Aug 29, 2018 Aug 29, 2018

Unless it can be done by opening a specific URL, it's not possible.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2018 Aug 29, 2018

Are you talking about a script in a PDF file or a web-page? If the former, it's not possible. If the latter, this is not the place for your question, as this forum is only about JS in PDF files...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 29, 2018 Aug 29, 2018

I would like to add the Javascript to a Button in a PDF Form.
The button would be called ADD TO CALENDAR.

When clicked it would add the event details to the users calendar (iCal, etc).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 29, 2018 Aug 29, 2018

Unless it can be done by opening a specific URL, it's not possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 29, 2018 Aug 29, 2018
LATEST

Thank you for your assistance - much appreciated.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines