Validation using javascript
Hi, Plz have look @ this..it working..not getting wat is going wrong here...its simple validation code using JSP;
<form id="form1" runat="server">
<div>
<script>
function IsValidUser()
{
var uid;
var temp = document.getElementById("<%=tbtest.ClientID%>");
uid = temp.valueOf();
if (uid == "")
{
alert("Plz Enter User ID");
return false;
}
else
{
return true;
}
}
</script>
</div><br />
<asp:TextBox ID="tbtest" runat="server"></asp:TextBox>
<asp:Button ID="btJavSctest" runat="server" Text="Script Test" OnClientClick="IsValidUser();"/>
</form>
Not showing message even if I click button with empty textbox
Plz help