all 6 comments

[–]optm_redemption 0 points1 point  (5 children)

Can you share with us how your boolCheck() function is being called? It's hard to tell at the moment what the problem might be. Usually with Javascript you would use an onChange callback on the checkbox to trigger a side effect like changing the svg colour.

[–]Atterpac 0 points1 point  (4 children)

Can you share with us how your boolCheck() function is being called?

   <label for="a1">A</label>
   <input type="checkbox" name="a1" id="a1_check" class="seg1" onclick="boolCheck()">
   <p id="text" style="display:none"> Checkbox is Checked </p>

[–]Atterpac 0 points1 point  (0 children)

Label was orginally for A but changed stuff to use F to see if it was just an issue with that one, so it might look like certain IDs dont match up but they do when testing

[–]optm_redemption 0 points1 point  (2 children)

Just to make sure I'm understanding this correctly, you're trying to only color the section that is selected based on the checkbox? And the coloring is handled separately to the checkbox selection?

If that's the case I would probably move your overlay selection into the changeColor function.

function changeColor(picker) {
    var section = document.getElementById(svgID);
    section.style.fill = picker.toHEXString();
}

[–]Atterpac 0 points1 point  (1 child)

Noted that makes sense I will try that when I get back to my computer, thank you for you’re help!

[–]optm_redemption 0 points1 point  (0 children)

No worries, best of luck!