On my webpage I have images that function as checkboxes (image switch and set hidden form property value). It works in every browser except IE6. Does anybody have a clue what is causing this problem?
The code:
function flip(element) {
var formElement = document.getElementById(element + "Form");
var imgElement = document.getElementById(element);
if (formElement.value == 1) {
formElement.value = 0;
imgElement.src = "images/"+element+".png";
} else {
formElement.value = 1;
imgElement.src = "images/"+element+"2.png";
}
}
and html example:
<input type="hidden" id="inteligencaForm" name="inteligenca" value="0">
<img id="inteligenca" src="images/inteligenca.png" class="pngfix" onClick="flip('inteligenca')">