473,785 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate Date in text box

Hello to all, I am developing an application ASP and desire to
validate the fields of dates before jumping to consultation SQL, the dates
is entered text boxes and the idea is that been worth when losing the Focus.
How I can do that? Thanks.


--
Marco Antonio Artus S.
Lakromsoft INC.
09-9594663
Jul 22 '05 #1
1 3256
A good starting point with be the IsDate function that is part of VB Script,
assuming you're using VB Script.

<%
If Not IsDate(Request. Form("txtDate") ) Then
Response.Write "Invalid date entered. Please correct it."
Response.End
End If
%>

http://msdn.microsoft.com/library/en...sfctIsDate.asp

Ray at work

"news.tie.c l" <pi******@conne ctmachine.cl> wrote in message
news:w7******** *******@jagger. tie.cl...
Hello to all, I am developing an application ASP and desire to
validate the fields of dates before jumping to consultation SQL, the dates
is entered text boxes and the idea is that been worth when losing the Focus. How I can do that? Thanks.


--
Marco Antonio Artus S.
Lakromsoft INC.
09-9594663

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
4809
by: Eddie | last post by:
I need to validate a text input field. I just want to say if user enters 93101 or 93102 or 93103 or 93105 or 93106 or 93107 or 93108 or 93109 or 93110 or 93111 or 93116 or 93117 or 93118 or 93120 or 93121 or 93130 or 93140 or 93150 or 93160 or 93190 or 93199 or 93199 or 93401 or 93402 or 93403 or 93405 or 93406 or 93407 or 93408 or 93409 or 93410 or 93412
4
1918
by: Frank Rocco | last post by:
Hello, What is the best way to validate a textbox to see if it contains a valid date or a valid time or both? Thanks Frank
2
1414
by: Fernando Lopes | last post by:
Hi. How can i validate a date textbox using validator, but the validator need to validate all data types, like: USA: 11/19/2004 BRAZIL: 19/11/2004 GERMANY: 19.11.2004 So, in the validator message, i need to show how is the mask according the country.
1
3155
by: VC | last post by:
I have a textbox where users type in a date. I want to check that the input is between year 2000 and the current date. Here is segment of the codes that give me the "Server tags cannot contain <%...%> construct" <asp:rangevalidator id="startDateValidator" runat="server" Type="Date" MinimumValue="1/1/2000" MaximumValue=<%=DateTime.Now.ToShortDateString()%> .. ..
5
19182
by: YardDancer | last post by:
Hi All, Does anybody have a routine for validating a date or DateTime entry in a textbox. I know i can use one of the DateTime.Parse(textbox.text) methods which would throw a Fromat Exception. What i am after is something like a IsNumeric() fuction or way i can test a value if it is dateTime value and recieve a boolean answer i.e. true or
6
2893
by: NH | last post by:
I want to allow users to enter dates in a text box in either the US "MM dd yy" format or the UK "dd MM yy" format. But how can I validate these dates? All the date functions e.g. ISdate, convert.ToDatetime etc fail on the US date format as the application and IIS is set to UK format. Its strange that the date format("12/03/06","MM dd yy") is interpretated correctly but format("12/22/06","MM dd yy") bombs out.
1
1202
by: bobby421 | last post by:
Hi, I have a master page and content page. In content page I have to validate the text boxes for name,address, phone number and email address etc. But as content pages doersn't have html section not head or body section so, where I use this java script in content page to validate the form. Thanks
5
13848
by: shapper | last post by:
Hello, What is the Regex expression to validate a date time format as follows: dd-mm-yyyy hh:mm:ss An example: 20-10-2008 10:32:45
1
4079
vavc1980
by: vavc1980 | last post by:
Hello, I have a couple of textboxes where I enter a date range (From - To), I need to validate that the Date From is greater (future) or at least equal to the Date From, or else give an error. I almost made it work, when I use the same format in the year (2 digits, or 4 digits) in both dates, but when one of them has a 2 digit year and the other 4 digit year, it does not work?? Is there a simple way to do this? I've been looking in...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.