This is the javascript. Here "FY" and "TY" are the 'id' for a select-box which has years listed in it.

function checkYear()
{
var y1= document.getElementById("FY");
var y2= document.getElementById("TY");
x1=y1.options[y1.selectedIndex].value;
x2=y2.options[y2.selectedIndex].value;
if(x2 < x1)
{
alert("'From' year should be less than or equal to 'To' year");
return false;
}
else
return true;
}

In that above function is not working. Whenever i run this function it display nothing. Actually the "if" condition is true then i am going to display one message using alert. But it is not displaying. What is the problem in this function ? Plaease Clarify with this. If i got the answer, i will post here.

--------------------
suresh