JavaScript in Custom HTML- can JS modify outside CustomForm?

Can you give me a specific example of what you are trying to do? Might help me understand how to help you a bit better.

There’s a few techniques you can use. You can call back to Anvil from JS using the technique in the link below. This would let you call a function which could in turn update a component’s properties (or “click” the button).

Calling Anvil from JS & vice versa :

But in brief -
You need to create a DIV and a unique ID in your custom html form (this is used purely to identify the calling form to Anvil) :

<div id="unique-form-id"></div>
...
<script>
    anvil.call($('#unique-form-id'), anvil_function [,parameters])
</script> 
1 Like