Hi,
I have a textbox to enter year in my Reg.aspx page. I want to restrict user, doesn't enter future year.How i do this? I want to do this with system date. Can anyone give me idea to do this?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Sep 14, 2013, 2:51 AM
http://www.aspsnippets.com/Articles/Dynamic-Date-Validation-using-JavaScript.aspx
Kavi sujaPosted Sep 14, 2013, 6:00 AM
Thank you for your reply.It works properly..The following link also helps me to solve this problem:
http://stackoverflow.com/questions/9360797/validate-textbox-for-date-of-birth
Sanjeeb LenkaPosted Sep 14, 2013, 2:44 AM
you can use ajaxcontroltoolkit to do that its simple:
add reference of ajaxcontrol tollkit
ex:
ErrorTooltipEnabled="True" />
InvalidValueMessage="Please provide a valid Birthdate." Display="Dynamic" EmptyValueBlurredText="*"
InvalidValueBlurredMessage="*" ValidationGroup="v1" MinimumValueMessage="Birth Date must after 01/01/1900."
MinimumValue="01/01/1900" MaximumValueMessage="Birth date should not future date." />
in .cs page load:
using AjaxControlToolKit;
MaskDobValidator.MaximumValue = DateTime.Today.ToString();
Kavi sujaPosted Sep 14, 2013, 2:34 AM
Thank you for your reply.Actually I want as below for validating a textbox for date of birth. The conditions are
Suthish NairPosted Sep 13, 2013, 9:18 AM