I have to execute a javascript function Test on Click event of a button.But the error is "Test is not identified as a function in the sourse file".Actually the exact function to be executed is YearValidation().But that function would work in the onFocus event but not with onClick.
Please help me.
<td colSpan="2"><asp:button id="btnReset" CssClass="Button" Runat="server" Text="Reset"></asp:button>
<asp:button id="btnSearch" CssClass="Button" OnFocus ="YearValidation()" OnClick="Test()" Runat="server" Text="Search"></asp:button></td>
Script function Defenition
function Test()
{
alert("Hi");
}
function YearValidation()
{
var yearTo=document.getElementById("ddlTo").value;
var yearFrom=document.getElementById("ddlYearRange").v alue;
if(yearTo<yearFrom)
{
alert("Error: Invalid year range selected. ");
}
}