Manoj Bisht

Manoj Bisht

  • NA
  • 145
  • 0

Calling Javascript funtion from Master Page

Mar 1 2008 4:34 AM

Hello Friends,

I'm providing the Javascript validation(s) in the Content Page of the Master Page

So my Javascript validation's code is given below :-

function validation()

{

if(document.getElementById("<%=ddlProgramme.ClientID %>").value=="Select")

{

window.alert("Please Select Your Programme");

document.getElementById("<%=ddlProgramme.ClientID %>").focus();

return false;

}

if(document.getElementById("<%=txtName.ClientID %>").value=="")

{

window.alert("Please Enter Your Name");

document.getElementById("<%=txtName.ClientID %>").focus();

return false;

}

}

 

and also provide the path for this js file in the Master Page as given below

<script language="javascript" src="../Script/JScript2.js"></script>

But my validation is not being fired as it must be....and also not throwing any error.............

 

But if i put my js code  given above in the content page directly then it works perfectly...........................

But  i want to call my validation in js file and want to call them from master page or content page........