I'm trying to place the following code in a field:
<a target="_blank"
href="https://www.keepersofthewater.ca/water-monitoring-site-uar-e3"</a><button style="background-color: #1F77B5; color: white; font-size: 18px; padding: 18px; border:none;">View Site Photos, Water Monitoring Data & Traditional Knowledge</button>
It works fine when I run it in the W3Schools validator, but when I paste it into a field in my map, I get an error. Interestingly enough, the errors vary with each attempt. Sometimes the error says the HTML is not valid, sometimes it says the operation is not supported.
I've used HTML in a field before (using an <a> element like the one in the code above, and that worked all right. But something is glitching with the <button> element or some aspect of the styling.
Can anyone help?
Thank you.
I am not sure you have this constructed properly. Are you trying to present the User with a Button to click that will launch the URL specified in the <a> tag ?
Either move the </a> to the end of thline so that the <button> is inside the <a> tag,
Or you need to specify a Class in the <a> tag of type button. Getting the CSS in place may be a little harder.
button is not a supported HTML tag. See Supported HTML—ArcGIS Online Help | Documentation for supported tags and attributes.
A workaround is use a div tag and style it like a button. Here is an example largely copied from arcade-expressions/popup/Display Chip.md at master · Esri/arcade-expressions:
<div style="display:inline-block;height:8%;vertical-align:middle;background:blue;border-radius:25px;padding:5px 20px;text-align:center;margin: 2px;color:white;"><a href="https://github.com/Esri/arcade-expressions/blob/master/popup/Display%20Chip.md" style="color:white;text-decoration:none;">see example from esri</a> </div>