A custom HTML component

I’ve had a fair number of use cases where I create a custom HTML form just for the purpose of adding it to another form as a component. But it’s only used on just that one other form.

Can that be simplified by adding in a component that is a custom HTML component? That component could be added directly to my form rather than needing to create the intermediate form. It could have an html property that could take any HTML you’d normally put into the custom HTML form.

This might be particular to how I think about Anvil, and to how I’m using iframes to display Anvil forms on an otherwise static site, so I’m not sure how useful it’d be to anyone else.

11 Likes

Hi,

I’m trying to do something like what you’re mentioning. I’m creating an interactive map that must be shown to the user with the most up-to-date data in it, but it should be updated when a button is clicked, then I’m trying to do that with ANVIL but so far I’m stuck in the first part. I mean, I have everything coded to create the map and save it as an HTML file, but cannot display it in the app… I mean, I don’t know how to do that, I’ve tried a couple of ways and I end up with the link to display the map, and when it’s clicked then it’s shown inside the app, but I want it to be more automated and not need to click the link, just the update button. If an HTML component is available then it’ll solve my problem for sure, but so far I’m stuck in this. Have an idea?

Thanks,

Billy.

Welcome to the forum!

Right now, create a Custom HTML form and drag that form onto another form. You can then set the html property of the custom html form component. If you have any issues with doing that, let us know.

Seeing this come back to life, I wondered how much it would take to get this kind of component running. Surprisingly it wasn’t very difficult and could be implemented with a single Jquery function:

https://anvil.works/build#clone:TQT4VCVUHEZD674L=VHXI2SFXYN44ZCISBQWYUNQ6

1 Like

There is an HtmlTemplate component in Anvil already. The only problem being that it can only be added using code instead of the Drag and Drop Designer. Also, there is Rich Text component now which can support restricted HTML.

1 Like