× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I had a situation where the user can enter the start date and end date of an
entity.  The year can be a few decades back so they wanted an input box for
the whole thing.  
 
But all that's for an input box....in fact there's only one place that I use
that!  
 
Most places I either use a calendar pop-up to do the selection or I use an
include that has the month comboBox; day comboBox (that is populated based
on the month selected and current year being shown); and a year comboBox
that populates with a range of years based on the parameters into the
include.
 
I agree, it's rare that you would need to validate a date if you lock down
the input fields.  There are those one in lot o times that it's required. 
 
 
 

----- Original Message ----- 
From: Goodbar, Loyd (ETS - Water Valley) <mailto:LGoodbar@xxxxxxxxxxxxxx>  
To: Midrange Systems Technical  <mailto:midrange-l@xxxxxxxxxxxx> Discussion 
Sent: Wednesday, March 15, 2006 10:26 AM
Subject: RE: date validate


Why should the year be required? Think about it like this: what is today - 
it's the 15th. You know it's March 15, 2006; you defaulted in the month and 
year. Why shouldn't our web pages be as smart? 

I'm not saying don't use JS and .net. Fill in a default date. Use Javascript

calendars. I like the philosophy of accepting as little input as possible 
from the user, and make the program smart enough to figure out what it 
needs. 

We're getting into design... Again, Javascript and .net validators are nice,

but outside of a controlled environment, you can't depend on them to ensure 
the input is "good". 

Loyd Goodbar 
Senior programmer/analyst 
BorgWarner 
E/TS Water Valley 
662-473-5713 

-----Original Message----- 
From: Michael_Schutte@xxxxxxxxxxxx [mailto:Michael_Schutte@xxxxxxxxxxxx
<mailto:Michael_Schutte@xxxxxxxxxxxx> ] 
Sent: Wednesday, March 15, 2006 08:54 
To: Midrange Systems Technical Discussion 
Subject: RE: date validate 

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
<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 



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.