<HTML>
<HEAD>
<TITLE>Simple Form</TITLE>
<Script type="javascript">
function demo()
{
var x=document.form[0].Fullname.value;
if(x==null || x=="")
{
alert("fill name ");
return false;
}
}
</Script>
</HEAD>
<BODY >
<Form name="form1" onSubmit="return demo();">
Name:<input type="text" name="Fullname">
<input type="submit" value="submit">
</Form>
</BODY>
</HTML>
Error was not on line 17 but in the function called from line 17.