I have a textbox and a linkbutton, i want that if textbox is empty then linkbutton disabled otherwise linkbutton enabled.
code are :
<input runat="server" type="text" id="txtName" onblur="CheckName('txtName','LinkButton1')" />
<asp:LinkButton Enabled="false" ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>
and javascript function are :
function CheckName(txt,btn)
{
var Name1= document.getElementById(txt).value;
if(Name1 != null)
{
document.getElementById(btn).disabled = false;
}
else
document.getElementById(btnNext).disabled = true;
}
Please help.
Thanks in advance.