Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Any way to add custom coding for a button on export? I thought that this would be possible by adding the code behind the button name or url box values, but it seems to filter out the necessary characters for the trailing code.

I have a few buttons that have custom javascript event coding associated with them. Things like app install prompts... I always have to manually paste in the necessary coding like "button id" and "onclick" after export.
in how_to by (460 points)
  

1 Answer

0 votes

You can apply JavaScript code as a button action, using the Go To URL action.
https://ajar.freshdesk.com/support/solutions/articles/26000035064-triggering-javascript-functions-with-indesign-in5

by (9.7k points)
I am familiar with this and am using the URL / javascript technique to run javascript code with this button. The problem is that the install button itself is hidden or visible by conditions via javascript code which references the button id.
You can target the button by a name that you assigned in InDesign. The jQuery is then, $('[name="BTN_NAME_FROM_ID"]').
You can also use class by apply an Object Style (and or the Exporting Tagging). That name will make it to the HTML element.