AndieR
09-08-2005, 04:19 PM
Hello!
I have say 3 different checkboxes (cat / dog / fish) in a page and five thumbnails of children pictures.
What I would like to do is to check or uncheck the animal checkboxes depending on which pets the children own without the page having to load again...
Like Peter has a dog and a fish while Jean has a cat.
I've been trying the code here but I can't seem to find a way to have one thumb select multiple checkboxes... just one. Any help would be greatly appreciated! :)
Regards,
AndieR
function checkABox(name) {
document.getElementsByName(name)[0].checked = true;
}
<input type="checkbox" name="fish"> <a href="#" onclick="return checkABox('fish')"> <img src="peter.jpg"> </a>
I have say 3 different checkboxes (cat / dog / fish) in a page and five thumbnails of children pictures.
What I would like to do is to check or uncheck the animal checkboxes depending on which pets the children own without the page having to load again...
Like Peter has a dog and a fish while Jean has a cat.
I've been trying the code here but I can't seem to find a way to have one thumb select multiple checkboxes... just one. Any help would be greatly appreciated! :)
Regards,
AndieR
function checkABox(name) {
document.getElementsByName(name)[0].checked = true;
}
<input type="checkbox" name="fish"> <a href="#" onclick="return checkABox('fish')"> <img src="peter.jpg"> </a>