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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 13, 2013, 10:51 PM EDT
http://www.aspsnippets.com/Articles/Dynamic-Date-Validation-using-JavaScript.aspx
Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 5:18 AM EDT
Kavi sujaRank #6,237 · 272 reputationPosted Sep 13, 2013, 10:34 PM EDT
Thank you for your reply.Actually I want as below for validating a textbox for date of birth. The conditions are
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 13, 2013, 10:44 PM EDT
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 sujaRank #6,237 · 272 reputationPosted Sep 14, 2013, 2:00 AM EDT
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