UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> How To Validate Varchar Field For Yyymmdd, classic    
 
   
smyeong
post Jun 11 2018, 04:42 AM
Post#1



Posts: 399
Joined: 6-November 02
From: Malaysia


Hi,there. I would like to enquire if i could write a vbscript or javascript that is to verify a varchar field so that it must fit this format YYYY/MM/DD? My page is coded in asp classic.

field :trdate varchar On the page, it was indicated with a remark yyyy/mm/dd..see attached

TQ

Attached File(s)
Attached File  Untitled.png ( 5.28K )Number of downloads: 0
Attached File  Untitled.png ( 5.28K )Number of downloads: 0
 
Go to the top of the page
 
DanielPineault
post Jun 11 2018, 11:33 AM
Post#2


UtterAccess VIP
Posts: 6,072
Joined: 30-June 11



See: https://stackoverflow.com/questions/1875877...dd-using-jquery

Your RegEx might be more like:

\d{4}[/](0?[1-9]|1[0-2])[/](0?[1-9]|[12][0-9]|3[01])




Why not use a date picker?
Why not use a Date/Time data type?




Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th September 2018 - 07:37 AM