hi,
replace your script by this . i am tested its working fine
<script type="text/javascript" language="javascript">
function Checkid ()
{
var name=document.getElementById('TxtName').value;
if(name=="")
{
alert("enter value in name field");
}
}
</script>
Happy Coding