Scenario:

The following works fine in Firefox and Chrome, but IE 8 will not call the submit() method when the anchor link is clicked.

<a href=”void(0);” onclick=”submit();”>Sign In<\a>

This is also the case for IE7. The solution that I used is:

Prototype code observer on <a> tag:


Event.observe('idofAnchorTag','click', function(event){
if($('removeAll').hasClassName('disabled')){
return false;
}else{
submit();
}
});

I use disabled class to turn off the button used in anchor tag which will make it feel like On/Off button.

Advertisements