Javascript validation not working in content page
Hello Friends,
This is my validation code given below and working great in content page if i put this code in the content page but whenever i put this code in jsfile and give the path of the jsfile in the master page then the validations don't fire .......plz suggest me the way
<script language="javascript">
function validate1()
{
if(document.getElementById("<%=txtOldPassword.Clie ntID%>").value=="")
{
window.alert("Please Enter Old Password");
document.getElementById("<%=txtOldPassword.ClientI D%>").focus();
return false;
}
else if(document.getElementById("<%=txtNewPassword.Clie ntID%>").value=="")
{
window.alert("Please Enter Your New Password");
document.getElementById("<%=txtNewPassword.ClientI D%>").focus();
return false;
}
else if(document.getElementById("<%=txtNewPassword1.Cli entID%>").value=="")
{
window.alert("Please Retype Your Password");
document.getElementById("<%=txtNewPassword1.Client ID%>").focus();
return false;
}
}
</script>
|