-
Apr 18th, 2015, 05:14 PM
#1
Thread Starter
Member
[RESOLVED] How do I validate a date that has been inputted to make sure it's in the correct form
Hi,
I have a bit of code which assigns a user input to a variable of data type string; this is done simply by using an Input Box. I need to validate the input so that firstly, it only accepts dates, and secondly so that it is in the form dd/MMM/yyyy. What's the best way of doing this? Can I somehow get a DateTimePicker in an input box without creating a new form?
Thanks
-
Apr 18th, 2015, 05:30 PM
#2
Re: How do I validate a date that has been inputted to make sure it's in the correct
No, you cannot get a DTP into an input box unless you create your own form... which relly isn't all that difficult.
but at any rate, use DateTime.ParseExact to determine if the date entered is in the correct format.
-tg
-
Apr 18th, 2015, 08:03 PM
#3
Thread Starter
Member
Re: How do I validate a date that has been inputted to make sure it's in the correct
Originally Posted by techgnome
No, you cannot get a DTP into an input box unless you create your own form... which relly isn't all that difficult.
but at any rate, use DateTime.ParseExact to determine if the date entered is in the correct format.
-tg
Can you give me an example?
-
Apr 19th, 2015, 10:42 AM
#4
Re: How do I validate a date that has been inputted to make sure it's in the correct
no. because there is a perfectly good one at the link i provided.
-tg
-
Apr 19th, 2015, 10:56 AM
#5
Thread Starter
Member
Re: How do I validate a date that has been inputted to make sure it's in the correct
Originally Posted by techgnome
no. because there is a perfectly good one at the link i provided.
-tg
Ahh didn't realize there was a link
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|