Microsoft JScript runtime error: Object required
- by Nani
I wrote a simple javascript function for validating to fields in a aspx page
function validate()
{
if (document.getElementById("<%=tbName.ClientID%>").value=="")
{
alert("Name Feild can not be blank");
document.getElementById("<%=tbName.ClientID%>").focus();
return false;
}
if (document.getElementById("<%=ddlBranch.ClientID%>").value=="SelectBranch")
{
alert("Branch Should Be Selected");
document.getElementById("<%=ddlBranch.ClientID%>").focus();
return false;
}
}
Everything worked fine.
Later I linked it to aspx page like a external js file.
Now its giving error "Microsoft JScript runtime error: Object required".
I'm unable to know where I went wrong.