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



What happens when I turn off JavaScript? All of your validation is broken.
Let me restate: don't rely on client-side validation unless you're in
complete control of the environment.

I validate all input (department codes, dates, etc.) on the server side
immediately after retrieving the values. I don't require users to enter
dates on reporting screens - a blank date to me means "today" or "the most
recent data in the system". Likewise, a missing year to me assumes the user
wants the current year.

Again, we're talking design. I'm just pointing out in the volatile browser
environment, you can't necessarily trust the browser to do the work for you.

I love a debate, can't you tell? I'll leave it alone from here.

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 09:48
To: Midrange Systems Technical Discussion
Subject: RE: date validate

I think that we're splittin' sea hairs.  I wasn't saying to use JS
validator.  Only to check the value of the YEAR field with JS.  If it's not
populated it, then you can default it with JS... Use JS to verify that the
USER is providing valid input.

I don't know about you, but I've always been taught that you validate the
page before continuing.  Validating the YEAR vs defaulting a YEAR are
different subjects.

Somehow, we've gotten off course... it's just my opinion... don't go
re-inventing the wheel.  Use what's provided.

Now don't get me wrong, I'm all for creating procedures (modules) when
needed. RPGLE doesn't provide a BIF to use proper case on a field.  So I've
created one of my own.  There's not one to center text into a field, so I
created my own.

We too have a date validator program.  It does several functions on the
date passed in.  But this was provided by the software vendor, not
something that we created on a whim.

This program will return the date in the format that is specified on the
company record, along with Hundred year format, the last day of the month,
the month abbreviation, etc.

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 10:26                                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             Midrange Systems                                              
                 Technical                                                 
                Discussion                                                 
             <midrange-l@midra                                             
                 nge.com>                                                  
                                                                           
                                                                           




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



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

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

Follow-Ups:

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.