The code above will only work once
my understanding is this
at first when mouseover on button it will check if the txtbox is empty or not and if its empty
the button will be disabled and when I mouseover again the button the event won't occur due to the button is disabled
so my solution is to disabled the button on pageload and add onChange event on textbox to check if its empty or not and then enable the button if its not empty
window.onload = function btnDflt(){
document.getElementById('<%= Button1.ClientID %>').setAttribute('Disabled','Disabled');
};
function chkItem()
{
var txt = document.getElementById('<%= TextBox1.ClientID %>').value;
if (txt.length != 0 )
{
document.getElementById('<%= Button1.ClientID %>').removeAttribute('Disabled');
}
}
<asp:button id="Button1" runat="server" text="Check Input"/>
Feel free to post/comment when you have a better solution cheers :)