|
-
May 1st, 2000, 10:03 PM
#1
Thread Starter
New Member
I'm using VBScript in an ASP environment and I have a form field that a user inputs a date they want to search on. I need the date in the format (MM/DD/YYYY) which is what the regional settings is set at. You can not do a mask on the field (not allowed by html). What I have done so far is
1) Check the date using (isDate) function
2) Switch the value using (Format) function
But the problem is when a user inputs "Jan 11" as a value it passes the (isDate) function and the (Format) function coverts it to (01/11/2000) and I can't assume that the user is looking for that date in the year 2000.
Does anyone know of a way to check date format quickly to see if it's valid.
I can write a function that checks the format, but I want the code in the asp page to be minimal, so I'm trying to find a short way of doing it.
Thanks
-
May 1st, 2000, 10:12 PM
#2
I'm fairly new to VB so correct me if I'm wrong...
But is there any reason you cannot require the Date Field to be entered with the MM/DD/YYYY format???
Thereby when someone enters "Jan 11", a msgbx would appear requesting the date to be added in the proper format?
Or by simply requesting the date be entered in a certain way by use of a label or text next to your form?
vbMarketer
-
May 1st, 2000, 10:18 PM
#3
Thread Starter
New Member
Originally posted by vbMarketer
I'm fairly new to VB so correct me if I'm wrong...
But is there any reason you cannot require the Date Field to be entered with the MM/DD/YYYY format???
Thereby when someone enters "Jan 11", a msgbx would appear requesting the date to be added in the proper format?
Or by simply requesting the date be entered in a certain way by use of a label or text next to your form?
vbMarketer
We do have a label next to the field and with html form elements they work differently than VB text boxes. You don't have as much flexiblity.
-
May 1st, 2000, 10:19 PM
#4
Frenzied Member
I don't know if you can get at it from VBScript but have you given any thought to the DTPicker or MonthView Controls, They are very good with dates and have a calender style interface.
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
|