I have a table, and each row contains a color name and the hex value I chose for that color
In a form I want to change the background of a field based on the HEX value.
This is the code I use in an AJAX onChange of the color code.
$clr= {colorHtml};
?>
<style>
#id_sc_field_swatch {
background-color: <?php echo $clr ?>;}
</style>
<?php
when I run it, and change the color, it changes the background of the field as I expect (see attached), but it also gives me a yellow output box which I interpret as an error in the CSS.
After I close the yellow box, the colouring disappears, as follows
I can turn off the AJAX error notification which suppresses the box, but then I never see any colouring of the field at all.
Has anyone experienced this?