Hi
I Have One DropDownList Which contains Months of Year which is as below
Select Month <asp:DropDownList ID="drpmonths" AutoPostBack="true" runat="server"
Width="121px" onselectedindexchanged="drpmonths_SelectedIndexChanged">
<asp:ListItem Value="1">January</asp:ListItem>
<asp:ListItem Value="2">February</asp:ListItem>
<asp:ListItem Value="3">March</asp:ListItem>
-
so on
</asp:DropDownLis
and im trying to validate on client side only when user selects Month Greater than present month so i write one Javascript
<script type="text/javascript">
function validmonth()
{
var month = document.getElementById('<%=drpmonths.ClientID%>').selectedIndex;
var d = new Date();
var n = d.getMonth();
if (month > n) {
alert('Selected Month is greterthan Todays Month');
}
}
</script>
is one function is der..