rfazendeiro Posted March 8, 2006 Posted March 8, 2006 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 allDateControl.zip Quote
jccorner Posted March 9, 2006 Posted March 9, 2006 Can you use the autopostback for the month dropdownlist and when the month is changed you rebuild the day combobox with the correct number of days?? Quote Applying computer technology is simply finding the right wrench to pound in the correct screw
rfazendeiro Posted March 10, 2006 Author Posted March 10, 2006 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.