hi all i know i am wrong in the date validation codes , please correct me , i am new to java script >> 3 1899 Dormilich 8,658
Recognized Expert Moderator Expert
there is a syntax error which would be listed in the Error Console. and line 48-50 do not make sense when compared to line 46.
additionally, your switch() statement is highly susceptible to execute checks you do not intend.
tip: the most simple leap year test I know: - function checkDay(day, month, year)
-
{
-
return (new Date(year, month-1, day).getMonth() == month-1);
-
// equivalent to
-
// return (new Date(year, month-1, day).getDate() == day);
-
}
@Dormilich
how should i break the date which is entered into the text field into date , month year
and wat does new date().getmonth () function does
Dormilich 8,658
Recognized Expert Moderator Expert
and wat does new date().getmonth () function does
see Description of the Date object
how should i break the date which is entered into the text field
consider the string you get. how could you break that up into the desired parts?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Dr John Stockton |
last post by:
It has appeared that ancient sources give a method for Numeric Date
Validation that involves numerous tests to determine month length;
versions are often posted by incomers here. That sort of code seems
unnecessarily long.
For some while, the following approach has been given here :-
function ValidDate(y, m, d) { // m = 0..11 ; y m d integers, y!=0
|
by: Steve Wright |
last post by:
I am trying to validate if an entry on a form is a date.
I have adapted code I found here
http://www.codingforums.com/archive/index.php/t-14325 as below but I can't
seem the get the results that I am expecting.
Can anyone help please
TIA
Steve
PS I'm new to javascript
|
by: Diego |
last post by:
Hi all a quick question: how can I validate a date in asp.net (2.0) with c#?
I didn't find a quick anwer.
Thanks, Diego.
|
by: LDD |
last post by:
Are there any built in time and/or date validation methods that one can make
use of in .NET?
thanks folks
LDD
|
by: pmarisole |
last post by:
The following javascript code gives me the date validation that I need
except
after the correct date is entered into the field, it puts the date in
the wrong format
EXAMPLE: User enters 2/14/2006 and it shows in the field Feb 14 2006
after the onBlur
I want it to leave the formatting of the date in the field as 2/14/2006
and not change the input to Feb 14 2006
| |
by: John Smith |
last post by:
Hello, I have a VB.NET application with a Windows form that have
several textboxes fields where I have dates entered. I would like to
do a date validation check after the the field is updated, so I' using
the leave event.
Right now I am creating a 'leave' sub for each of the fields.
However, I'd like to simplify that and just call the name of a
function and plug the field name as a variable and be done.
In other words, I would like...
|
by: jsredhar |
last post by:
Dear Experts,
I have two text boxes in my form (f1) i'm prompting the users to select the date from callender which is embeded within the from. when the users Pick the date from the calender.it will be displayed as mm/dd/yyyy format.
i'm getting the from date value at textbox (FromDate)
and to date value at another textbox(ToDate). i've to validate that the to date should not be lesser than that of from date validation must be check date...
|
by: pradeepjain |
last post by:
<script language = "Javascript">
/**
* DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
|
by: Stang02GT |
last post by:
I have been asked to validate a date on our web-page so that people cannot enter dates like 14/1/08 or 2/30/06. I have found code that will do exactly what i need it to do, but i am not sure how to call it. It was suggested to be to have it run through an if statement and if the user enters an invalid date it will kick them to an error page.
Here is the date validation code.
// date validation using SimpleDateFormat
// it will take a...
|
by: mshroom12 |
last post by:
I am having trouble with the following project on hand. I use Eclipse to do my work in Java. This is what I'm supposed to complete.
Date Validation
In this exercise you will write a program that checks to see if a date entered by the user is a valid date in the second millenium. A skeleton of the program is in Dates.java. Open this program and save it to your directory. As indicated by the comments in the program, fill in the following: ...
|
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,...
| |
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |