Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a very simples user control for a user to enter a date. I know i should use the datetimepicket but i got this project where they already used this control.

 

The control has 3 dropdownlists that are day, month and year. Each of these dropdownlists theere is a default value with a string saying Day, Month and Year respectavly. and besides that, the control does not see if the motnth has 31 ou 30 days.

 

my problem is that i can only validade the date inputed pu the user after a submit and i wanna change that. I would like to be able to validate this before a submit, just like a asp.net validator does.

 

any sugestions on how to acomplish this?

 

 

P.S --> i post in attach the control code

 

 

thx to all

DateControl.zip

Posted

I can do that but that would require that the user insert the month first.

 

What i could do is when the month is selected i check to see if the day is valid. If not i try to find the next valid day.

 

for example a user chooses 31 of febuary. In the postback i would check if it's a valida date, if not calculate the nearest valid day. In this case 28 (or 29 depending) of febuary

 

i'll give it a try

 

thx for the reply

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...