I initially tried to solve this issue using css but in vain. Later I read in a forum that for some html items stylesheet hover doesn’t work in IE and Input Type = “Image” is one of them L
So I next tried to solve it using Javascript and my initial solution looked like this:
input type = "Image" src = "info.gif" onclick = "alert('hi');" disabled=”disabled” onmouseover="setMouseHover(this);"
Js function
function setMouseHover (element)
{
element.disabled = 'disabled';
}
The above solution dint work b’coz the event onmouseover doesn’t fire when the Input Type is disabled.
So my final solution looked like this
input type = "Image" src = "info.gif" onclick = "alert('hi');" onmouseover="setmousehoverdisable (this);"
Js function
function setmousehoverdisable (element)
{
element.style.cursor='default';
element.disabled = 'disabled';
}
So what happens is initially the image button is enabled and then the style is set through javascript and then the image button is disabled using javascript. This solves the problem but I just want to know if there is any other elegant way of doing this.
No comments:
Post a Comment