Click to See Complete Forum and Search --> : IE5 problems, but IE6 works.


awegrzyn
10-06-2003, 11:16 AM
why this function does not work on IE5 but works on IE6.

function CheckImageBtn(eleName,sortfield)
{
document.forms[0].sortby.value=sortfield;
document.forms[0].txtIsHrefClick.value = 'Y';

var objElem;
objElem=eval("document.all."+eleName);
objElem.focus();
objElem.click();
return true;
}

Thanks,

Andrzej

Jona
10-06-2003, 01:36 PM
Replace this


objElem=eval("document.all."+eleName);


With this


objElem=document.forms[0].elements[eleName];


If that doesn't work, you might want to post your form's HTML code.

[J]ona

awegrzyn
10-06-2003, 01:50 PM
Thanks for the reply. I was calling it using the <a href=""> tag. I forgot to use return false;. I don't have IE 5, so that's why I asked this question.

Your answer is great too.

Andy

Jona
10-06-2003, 01:53 PM
Well, I'm glad you got it to work.

[J]ona