View Full Version : radiobutton image will not swap on IE7

10-09-2008, 09:52 AM


The problem with this site is that reset button wont function properly in IE7 and i guess older versions as well.
If you click the first (blue) tab , and check some boxes , then the reset button should reset the form.
The checkboxes are in fact radio buttons that use either a "checked" or "unchecked" image.
On the radioboxes it swaps the "checked" to "unchecked" image dynamicaly. It works fine on Firefox 3 but not on IE7. After some research I have come to the conclusion that IE7 works only on a static DOM so what i am tryin to do is not possible in IE7.

here is the piece of javascript that swaps the images when reset is called :

function resetForm(inFormName){

forma = document.getElementById(inFormName)


for(var element in elements){
element = elements[element];

if(element.type!==null && element.type!==undefined){
// Only do reset if it's allowed

imgid = 'img' + element.id;
if (document.getElementById(imgid)) {
img = document.getElementById(imgid);
if (element.checked) {
file = img.src.replace(/checked/, "unchecked");
img.src = file;

Again , it works fine on FF3 but not on IE 7. Is there anyway to make it work on IE or am i just wasting my time?

Thanx in advance!!

10-10-2008, 08:03 PM
your link drove us to a non-existent document