ASP.Net C# and JavaScript textfield expiration date -
i looking textbox user can enter expiration date his/her license. user can enter expiration date between today's date , 12/31/2099.
this have now:
function rangevalidation(dt) { var startrange = new date(date.parse("12/02/1900")); var endrange = new date(date.parse("12/31/2099")); var lblmesg = document.getelementbyid("<%=lblmesg.clientid%>") ; if (dt<startrange || dt>endrange) { lblmesg.style.color="red"; lblmesg.innerhtml = "date should between 12/01/2014 , 12/31/2099"; } } <asp:textbox id="txtrange" runat="server" maxlength = "10" onkeyup = "validatedate(this, event.keycode)" onkeydown = "return dateformat(this, event.keycode)"></asp:textbox>
is there easier way that? running date issues, exampele dd/mm/yyyy , on, simple in asp.net (i don't prefer using javascript cause not familiar it)
thanks.
you may use asp.net rangevalidator, if fits requirement. following links may you:
Comments
Post a Comment