Why wouldn't you validate that YEAR was specified before allowing the page
to be submitted?

You're right, garbage in, garbage out.  To me, the YEAR check should be
done interactively on the page, not in a CGI process.

I won't go .net on you, as I don't use it here.  I don't know enough of it.
But JavaScript can be used to test the value. :-)

Michael Schutte
Work 614-492-7419
email  michael_schutte@xxxxxxxxxxxx


                                                                           
             "Goodbar, Loyd                                                
             (ETS - Water                                                  
             Valley)"                                                   To 
             <LGoodbar@borgwar         Midrange Systems Technical          
             ner.com>                  Discussion                          
             Sent by:                  <midrange-l@xxxxxxxxxxxx>           
             midrange-l-bounce                                          cc 
             s@xxxxxxxxxxxx                                                
                                                                   Subject 
                                       RE: date validate                   
             03/15/2006 09:29                                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             Midrange Systems                                              
                 Technical                                                 
                Discussion                                                 
             <midrange-l@midra                                             
                 nge.com>                                                  
                                                                           
                                                                           




Always, it depends...

What do you do when you receive date input from a web page? Suppose I have
separate fields for the month, day, and year. The user types in the month
and day only. All TEST opcode operations will fail. How do I test the date?

I did something similar with the express purpose of validating dates from
web pages. That way, if the user puts in just the month and day, I can
default in the current year.

The problem I have with the TEST opcode is I need to know the date format
to
test. Now depending on how the date input fields are set up, that could be
easy or difficult. I prefer to use separate input fields for better
control.
An all-in-one field that can be used in .net could provide some confusion.

Don't go all .net on me, either. Yes, the date validator in .net is helpful
and nice, but don't forget the mantra for web applications: don't trust
user
input. Don't rely on the .net validator to ensure your program has valid
dates.

We don't know the OP's application target (5250, web), but having a more
robust and flexible validation routine than TEST can't hurt, for the
reasons
Bill mentioned.

Loyd Goodbar
Senior programmer/analyst
BorgWarner
E/TS Water Valley
662-473-5713
-----Original Message-----
From: Michael_Schutte@xxxxxxxxxxxx [mailto:Michael_Schutte@xxxxxxxxxxxx]
Sent: Wednesday, March 15, 2006 08:01
To: Midrange Systems Technical Discussion
Subject: Re: date validate

My opinion is that it's a waste of time to go through all that trouble.
Making a mountian out of a mole hill.  If all you want to do is test the
date value in a character or numerical field, then just use the TEST
function.

Michael Schutte
Work 614-492-7419
email  michael_schutte@xxxxxxxxxxxx

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.